Implemented initial PHP classes for time value objects, including Instant and Timezone.#1
Conversation
…ng Instant and Timezone.
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
…ng Instant and Timezone.
There was a problem hiding this comment.
Pull request overview
Adds the initial implementation of immutable time value objects for the TinyBlocks\Time library (notably Instant, Timezone, and a Timezones collection), plus project tooling (tests, static analysis, mutation testing) and CI/security workflows.
Changes:
- Introduces
Instant(UTC-normalized) with string decoding and Unix-seconds constructors, plus formatting/accessors. - Adds
TimezoneandTimezonescollection utilities (construction, lookup, conversion). - Establishes testing + quality/CI scaffolding (PHPUnit, PHPStan, Infection, GitHub Actions, docs/build files).
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/Instant.php |
Adds the Instant value object (now/fromString/fromUnixSeconds + format/accessors). |
src/Timezone.php |
Adds a Timezone value object validating IANA identifiers. |
src/Timezones.php |
Adds an immutable collection wrapper for Timezone objects. |
src/Internal/TextDecoder.php |
Introduces a decoder pipeline used by Instant::fromString. |
src/Internal/Decoders/Decoder.php |
Defines the decoder interface for parsing text into DateTimeImmutable. |
src/Internal/Decoders/OffsetDateTimeDecoder.php |
Implements offset datetime parsing + UTC normalization. |
src/Internal/Exceptions/InvalidInstant.php |
Adds domain exception for invalid instants. |
src/Internal/Exceptions/InvalidTimezone.php |
Adds domain exception for invalid timezones. |
tests/InstantTest.php |
Adds coverage for Instant behavior (parsing, normalization, formatting, timestamps). |
tests/TimezoneTest.php |
Adds coverage for Timezone validation and conversions. |
tests/TimezonesTest.php |
Adds coverage for the Timezones collection behaviors. |
phpunit.xml |
Adds PHPUnit configuration and coverage reporting. |
phpstan.neon.dist |
Adds PHPStan configuration. |
infection.json.dist |
Adds Infection mutation testing configuration. |
composer.json |
Defines package metadata, dependencies, and scripts. |
README.md |
Adds usage documentation for Instant, Timezone, Timezones. |
Makefile |
Adds local dev/test/review helpers via Docker. |
.gitignore |
Adds ignore rules for vendor/reports/cache/locks. |
.gitattributes |
Excludes non-distribution files from exported archives. |
.github/workflows/ci.yml |
Adds CI pipeline (install, review, tests). |
.github/workflows/codeql.yml |
Adds CodeQL workflow for security checks. |
.github/workflows/auto-assign.yml |
Adds auto-assign workflow for issues/PRs. |
.github/dependabot.yml |
Adds Dependabot configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c448218ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
No description provided.