Skip to content

Add month and year arithmetic to LocalDate and Instant.#14

Merged
gustavofreze merged 1 commit into
mainfrom
feature/develop
Jul 23, 2026
Merged

Add month and year arithmetic to LocalDate and Instant.#14
gustavofreze merged 1 commit into
mainfrom
feature/develop

Conversation

@gustavofreze

Copy link
Copy Markdown
Member

The new plusMonths, minusMonths, plusYears, and minusYears methods clamp to the last valid day of the target month, and on Instant they reanchor through a timezone before normalizing back to UTC. Shifts crossing the supported 0001 to 9999 range raise InvalidLocalDate. This change also adopts the Slevomat coding standard and migrates phpcs to it.

Please follow the contributing guidelines.

Summary

What this pull request does.

Related issue

Closes #...

Checklist

  • Tests added or updated.
  • Documentation updated when applicable.
  • composer review passes.
  • composer tests passes.

The new plusMonths, minusMonths, plusYears, and minusYears methods clamp
to the last valid day of the target month, and on Instant they reanchor
through a timezone before normalizing back to UTC. Shifts crossing the
supported 0001 to 9999 range raise InvalidLocalDate. This change also
adopts the Slevomat coding standard and migrates phpcs to it.
@gustavofreze
gustavofreze merged commit 09da8b5 into main Jul 23, 2026
7 checks passed
@gustavofreze
gustavofreze deleted the feature/develop branch July 23, 2026 21:07
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.

1 participant