Skip to content

Allow null when Twig expects a string#3617

Merged
fabpot merged 1 commit intotwigphp:2.xfrom
fabpot:8.1-fixes
Jan 2, 2022
Merged

Allow null when Twig expects a string#3617
fabpot merged 1 commit intotwigphp:2.xfrom
fabpot:8.1-fixes

Conversation

@fabpot
Copy link
Contributor

@fabpot fabpot commented Jan 2, 2022

To ease the transition to PHP 8.1, Twig now explicitly accepts null in addition to strings in filters that expect strings.

Closes #3615
Closes #3557
Closes #3610
Closes #3609

@fabpot fabpot merged commit 5ff0432 into twigphp:2.x Jan 2, 2022
@fabpot fabpot deleted the 8.1-fixes branch January 2, 2022 16:21
ruudk added a commit to ruudk/Twig that referenced this pull request Jan 3, 2022
@ruudk ruudk mentioned this pull request Jan 3, 2022
ruudk added a commit to ruudk/Twig that referenced this pull request Jan 3, 2022
ruudk added a commit to ruudk/Twig that referenced this pull request Jan 3, 2022
ruudk added a commit to ruudk/Twig that referenced this pull request Jan 3, 2022
ruudk added a commit to ruudk/Twig that referenced this pull request Jan 3, 2022
ruudk added a commit to ruudk/Twig that referenced this pull request Jan 3, 2022
fabpot added a commit that referenced this pull request Jan 3, 2022
This PR was merged into the 2.x branch.

Discussion
----------

Allow null for `nl2br`

Same as #3617
Fixes `Passing null to parameter #1 ($string) of type string is deprecated` on PHP 8.1

Commits
-------

e9cd55d Allow null for nl2br, striptags and format filters
la5942 added a commit to la5942/Twig that referenced this pull request Feb 7, 2023
… subject to result in a non-match.

Resolves BC break introduced in PR twigphp#3687

As per pattern in twigphp#3617
fabpot added a commit that referenced this pull request Feb 8, 2023
…942)

This PR was merged into the 3.x branch.

Discussion
----------

Restores the leniency of the `matches` twig comparison

Restores the leniency of the `matches` twig comparison, allowing null subject to result in a non-match.

Resolves BC break introduced in PR #3687 ref in #3801 (comment)

As per pattern in #3617

Commits
-------

f136668 Restores the leniency of the `matches` twig comparison, allowing null subject to result in a non-match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant