-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
symfony/yaml PHP 8.1 Compatibility #52326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This class is internal. |
@nicolas-grekas we should still check why our argument has a default value being |
@nicolas-grekas I think we probably need to dig in deeper to how we are using this method tbh. So I'll do some digging into this as well. |
I think the author reports deprecation warnings he wants to get rid of. |
@javaDeveloperKid but then, we still need to know which code path triggers that deprecation, to find where we end up passing null to this method. |
@stof we can't rule out that someone violates |
@javaDeveloperKid & @stof if you look at the function the default value if none is supplied is public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed |
FYI, I patched this code using a |
The class is marked as |
@GromNaN FYI, we are not calling that method directly actually. We are calling |
Could you provide an example? So that we can fix the |
@GromNaN our call is just this: https://github.com/forumone/wp-cfm/blob/develop/includes/class-readwrite.php#L204 I believe we can probably squash the deprecation warning by ensuring we aren't passing a |
You are the using |
@GromNaN actually I have an open PR to upgrade to v5. https://github.com/forumone/wp-cfm/blob/fix/135-php81-deprecations/composer.json#L29 |
👍🏻 In 5.4, only strings are accepted by |
…rKid) This PR was merged into the 5.4 branch. Discussion ---------- [Yaml] Fix deprecated passing null to trim() | Q | A | ------------- | --- | Branch? |5.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Closes #52326 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT Commits ------- 54fc3c5 Fix passing null to trim()
This PR was merged into the 6.4 branch. Discussion ---------- [Yaml] `Inline::parse(null)` not allowed | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix #52326 | License | MIT It's only called with string values in the Yaml component. This class is internal. It allows to change the arg type. The arg type was documented as `string`. 7b1715b#diff-1d97fcfb29e99f0200c3952e9a1a11c4b9f825c0f5ad4d4515b9b1805f8c988eR47 Commits ------- 834e0ab Passing null to Inline::parse is not allowed
Symfony version(s) affected
6.3.3
Description
The
trim()
method will no longer accept a null value.https://github.com/symfony/yaml/blob/6.3/Inline.php#L62
Deprecation warnings are thrown when this method is used.
How to reproduce
Possible Solution
Need to validate that
$value
is notnull
before attempting totrim()
.Additional Context
No response
The text was updated successfully, but these errors were encountered: