Skip to content

Read the cache's time through Support\Clock - #24

Merged
imanimanyara merged 1 commit into
mainfrom
fix/cache-clock
Nov 16, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
fix/cache-clock

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Summary

Found while running the per-PR merge checklist against v0.1.0 (8146f73).

  • SettingsCache was the only class calling the global now() helper; every other class takes the package's Support\Clock. It now takes Clock the same way it takes BagCodec. Behaviour is unchanged: both read Laravel's date seam.
  • New architecture rule: now() and today() are refused outside Providers and Facades. Seen failing on the old code ("Expecting 'Simtabi\Laranail\Settings' not to use 'now'") before the fix.
  • CHANGELOG [Unreleased] entry.

Local: 742 tests pass, Pint, PHPStan level max and Rector clean.

SettingsCache was the one class calling the global now() helper; every other class takes the package Clock. An architecture rule now refuses now() and today() outside the providers and facades, and was seen failing on the old code before the fix.
@imanimanyara
imanimanyara merged commit 9f78859 into main Nov 16, 2026
14 checks passed
@imanimanyara
imanimanyara deleted the fix/cache-clock branch November 16, 2026 18:10
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