Repository navigation
Issue/599 Allow psr/log 3 next to psr/log 2 - #604
Merged
Merged
Conversation
composer.json accepts psr/log ^2.0 || ^3.0. psr/log 3 could not be installed while symfony/console 5.4 conflicted with it; the console is on 6.4 now. Both versions declare string|\Stringable for the message, so the Logger methods declare it natively too.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
emergency(), alert() and critical() were never called by a test, because the global helpers cover only the other five levels. The tests check that each level method reports its message with its level, and that a Stringable message is accepted.
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.
Closes #599. Part of #595. The changelog entry is written in a final pull request, after the sub-issues.
What changed
composer.jsonrequirespsr/log^2.0 || ^3.0instead of^2.0.Logger(emergency,alert,critical,error,warning,notice,info,debugandlog) declarestring|Stringable $message.Why
Applications that already use psr/log 3, for example through Monolog 3, could not install Quantum. The constraint was one reason;
symfony/console5.4 was the other, because it declares a conflict with psr/log 3 or newer. The console is on 6.4 since #596, so Composer can now resolve psr/log 3.psr/log 2 and 3 declare the same parameter type,
string|\Stringable, and differ only in the: voidreturn type, whichLoggeralready has. The native type on our methods therefore fits both versions.Breaking changes
report()already accepted onlystring|Stringable, so theLoggermethods only state what happened further down.Testing
composer update psr/log --with psr/log:^2.0.Notes for reviewers
logger()->info([...])with an array, which the Logger docs describe, throws aTypeErrorbecause the adapters'report()accepts onlystring|Stringable. That is independent of this change and tracked separately.