lint/classes/add-stringable
In the lint-recommended preset and every stricter one. In Rector’s rector/php80 set. Safe fix.
What it does
A class that implements the __toString() method must explicitly implement the Stringable interface.
Configuration
[lint.rules]
"classes/add-stringable" = "error"
To skip it in some files, add an override or a @pun-ignore-file comment.
Replaces
stringable_for_to_string(php-cs-fixer)StringableForToString(rector)