Repository navigation
docs: correct the Logger override guidance - #150
Merged
Merged
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.
Corrects a statement added in #148 and #149.
What changed
v3.0/upgrade-guide.md, section 1: the paragraph onpsr/logsaid a class that extendsLoggerand overrides the PSR-3 methods must declarestring|Stringable $message, with a before and after example. That is not needed. An override with no parameter type, or withstring|Stringable, is valid. PHP rejects an override that narrows the type, for example tostring, and it did before as well. The example is removed.v3.0/packages/logger/contracts.md: the same sentence is reworded to state that rule.Checked on PHP 8.1 against a parent whose method takes
string|Stringable $message: an untyped override and astring|Stringableoverride load, astringoverride is a fatal error. The framework changelog entry for this change was corrected the same way (quantum-php/framework#609).Changed paths
v3.0/upgrade-guide.mdv3.0/packages/logger/contracts.mdSUMMARY.md: no change.