Repository navigation
Add retry logging and Symfony clock support, allow webmozart/assert 2 (0.1.1) - #2
Merged
Merged
Conversation
- RetryClient takes an optional PSR-3 logger and logs every retry, and every retry prevented by maxDuration, at info level; entries never contain the query string or a body - Clock\SymfonyClockAdapter lets RetryClient and GenericRetryStrategy use a Symfony clock (and its MockClock in tests) - webmozart/assert ^1.11||^2.0, so the library installs next to packages that need Assert 2 - symfony/clock dev floor ^6.4.13: 6.4.0 triggers PHP 8.4+ deprecations under --prefer-lowest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Three additions so the library can replace the hand-rolled HTTP clients in a Symfony app.
webmozart/assert 2: the constraint is now
^1.11||^2.0. Apps that lock Assert 2 (e.g. throughphpdocumentor/reflection-docblock) could not install 0.1.0. No code changes were needed: the whole suite and PHPStan pass on Assert 2.5.Retry logging:
RetryClienttakes an optional PSR-3loggerand logs atinfoRetrying "GET items" after HTTP 503 in 1s (retry 1 of 3).maxDurationprevents.The context holds
status_code,retry,max_retries,delayandmax_duration. Entries never contain the query string or a body.psr/log(^1.1||^2.0||^3.0) is now a requirement.Symfony clock:
Clock\SymfonyClockAdapterletsRetryClientandGenericRetryStrategyuse a Symfony clock, e.g. the framework'sclockservice, so Symfony'sMockClockdrives retry delays in tests.symfony/clockis suggested, not required.Also:
RetryClient::request()is split up to stay under the cognitive-complexity limit; behaviour is unchanged.symfony/clockdev floor is^6.4.13, because 6.4.0 triggers PHP 8.4+ deprecations under--prefer-lowest.CHANGELOG.md.Verification
make testson PHP 8.5 with the highest dependencies: unit 64, integration 13, e2e 2--prefer-lowest --prefer-stableon PHP 8.2 and 8.5 (Docker) withpsr/log1.1.0,webmozart/assert1.11.0,symfony/clock6.4.13: greenmake cs-check,make analyseandrector --dry-runare clean🤖 Generated with Claude Code