Skip to content

Add distance calculation for days of the week and improve TimeOfDay parsing.#7

Merged
gustavofreze merged 2 commits intomainfrom
feature/develop
Mar 7, 2026
Merged

Add distance calculation for days of the week and improve TimeOfDay parsing.#7
gustavofreze merged 2 commits intomainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 7, 2026 17:47
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 accept HH:MM:SS and 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.

@gustavofreze gustavofreze merged commit 5123e6e into main Mar 7, 2026
5 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch March 7, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants