Add distance calculation for days of the week and improve TimeOfDay parsing.#7
Add distance calculation for days of the week and improve TimeOfDay parsing.#7gustavofreze merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afdb3c1ad2
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Adds new day-of-week functionality and expands TimeOfDay parsing to better support database-style time strings, with accompanying documentation and tests.
Changes:
- Add
DayOfWeek::distanceTo()for forward (wrap-around) day distance calculations. - Update
TimeOfDay::fromString()to acceptHH:MM:SSand discard seconds. - Expand PHPUnit coverage and README examples for both features.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/DayOfWeek.php |
Adds distanceTo() API and supporting constant for week distance math. |
tests/DayOfWeekTest.php |
Adds data-provider-driven test coverage for distanceTo() and adjusts weekday/weekend exclusivity assertions. |
src/TimeOfDay.php |
Updates parsing regex to accept optional seconds and documents seconds-discard behavior. |
tests/TimeOfDayTest.php |
Updates expectations to assert seconds are discarded rather than throwing. |
README.md |
Documents the new distanceTo() API and the expanded TimeOfDay::fromString() format support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.