Preserve legacy timestamp factory construction - #41
Draft
alexstandiford wants to merge 2 commits into
Draft
alexstandiford wants to merge 2 commits into
alexstandiford wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DateCreatedFactoryandDateModifiedFactorygained a requiredClockStrategyconstructor in the 3.0 line. Existing Siren and Navigator table definitions construct these factories with no arguments, so the next DB integration fails during table schema construction before database tests can run.This keeps clock injection available while preserving the established no-argument API. When no clock is supplied, the factory uses the same
DateTimeImmutablewall-clock behavior it had before the constructor change.Scope
ClockStrategyoptional on both timestamp factories.Consumer audit found direct no-argument construction in 28 Siren files, 92 Navigator files, and 8 Courier files. Siren has 23 direct
DateModifiedFactoryconsumers. Updating each table would be a broad migration and would not repair the public factory compatibility contract.Validation
00e9a5findependently reproduced the fatalDateCreatedFactory::__construct()requirement before this repair. Those suites could not proceed to their normal assertions because the schema definitions fail during construction.This PR is intentionally independent of the identity-query PR and is based directly on DB
main43551fc.CI prerequisites activated here
The repository's inherited gates were not previously honest on current main:
.wordlist.txt. They are now listed without changing README content.phpstan.neonincludes that baseline at level 9. A deliberate temporary return-type error was detected with exit code 1, proving the baseline does not hide new defects.Local post-change checks: full PHPUnit 17/40 green, full configured PHPStan level 9 green, deliberate new type error rejected. GitHub build-test, PHPStan, and Spellcheck are green on commit
2f4e78f.