Skip to content

docs: correct the Logger override guidance - #150

Merged
armanist merged 2 commits into
stagingfrom
docs/3-1-logger-override-fix
Oct 23, 2026
Merged

armanist merged 2 commits into
stagingfrom
docs/3-1-logger-override-fix

Conversation

@armanist

Copy link
Copy Markdown
Collaborator

Corrects a statement added in #148 and #149.

What changed

  • v3.0/upgrade-guide.md, section 1: the paragraph on psr/log said a class that extends Logger and overrides the PSR-3 methods must declare string|Stringable $message, with a before and after example. That is not needed. An override with no parameter type, or with string|Stringable, is valid. PHP rejects an override that narrows the type, for example to string, 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 a string|Stringable override load, a string override 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.md
  • v3.0/packages/logger/contracts.md

SUMMARY.md: no change.

@armanist
armanist merged commit fbb96d9 into staging Oct 23, 2026
1 check passed
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