You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Just recently started really using the component and am finding it annoying that a string can't be constructed with null (think nullable entity fields). Maybe at least the helper functions? I wanted to gauge interest before submitting a PR.
There was a PR accepted to allow this for the Twig StringExtension (twigphp/Twig#3259).
Example
Instead of s((string) $possibleNullString), it would be nice to just do s($possibleNullString).
The text was updated successfully, but these errors were encountered:
This PR was submitted for the 5.1 branch but it was merged into the 5.2-dev branch instead.
Discussion
----------
[String] allow passing null to string functions
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#38260
| License | MIT
| Doc PR | n/a
I also added a default value for `s` to match the other functions.
Commits
-------
f20a318 [String] allow passing null to string functions
Description
Just recently started really using the component and am finding it annoying that a string can't be constructed with
null
(think nullable entity fields). Maybe at least the helper functions? I wanted to gauge interest before submitting a PR.There was a PR accepted to allow this for the Twig StringExtension (twigphp/Twig#3259).
Example
Instead of
s((string) $possibleNullString)
, it would be nice to just dos($possibleNullString)
.The text was updated successfully, but these errors were encountered: