Proposal:
Try to convert non-string-tags to strings or throw an Exception
Current behavior:
Right now, if non-string-values are added as tags those values are ignored silently, which is not very helpful.
Desired behavior:
There are IMHO three non-exclusive options:
Add a TypeHint to addTag. But this will not help, if the tags are passed to the constructor
Check, if the value is a scalar or an Instance of Stringable (>= php 8.0) or an object with a __toString() function and convert such values to strings.
Throw an exception or at least a warning for non string tags.
I will open a PR for this.
Alternatives considered:
none
Use case:
Ignoring non-string-tags silently may require manual debugging.
Proposal: Try to convert non-string-tags to strings or throw an Exception
Current behavior: Right now, if non-string-values are added as tags those values are ignored silently, which is not very helpful.
Desired behavior: There are IMHO three non-exclusive options:
I will open a PR for this.
Alternatives considered: none
Use case: Ignoring non-string-tags silently may require manual debugging.