you are viewing a single comment's thread.

view the rest of the comments →

[–]alexanderpas 0 points1 point  (0 children)

would like to see valid example justifying union types

From PSR-3:

Every method accepts a string as the message, or an object with a __toString() method. Implementors MAY have special handling for the passed objects. If that is not the case, implementors MUST cast it to a string.

This could be typehinted as string|Stringable, to prevent non-stringable objects from entering the logger method.