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
A warning is triggered in vendor/symfony/config/Definition/PrototypedArrayNode.php:252 because $k is a float. Normalization doesn't work because the value is extracted and cannot be normalized. The root cause is in \Symfony\Component\Config\Util\XmlUtils::phpize because number is converted to a float, which is correct in all cases. But not when using the attribute as a key. Than it should be converted back to a string or integer value when the type is not allowed as a array key.
In this case a string would be expected.
Possible Solution
Use var_export to convert the value of $k back to a string when it was a float / boolean
Symfony version(s) affected: 5.0
Description
Given a config like this:
We wanted to have the output as:
The definition looks like this:
A warning is triggered in vendor/symfony/config/Definition/PrototypedArrayNode.php:252 because
$k
is a float. Normalization doesn't work because the value is extracted and cannot be normalized. The root cause is in\Symfony\Component\Config\Util\XmlUtils::phpize
because number is converted to a float, which is correct in all cases. But not when using the attribute as a key. Than it should be converted back to a string or integer value when the type is not allowed as a array key.In this case a string would be expected.
Possible Solution
Use
var_export
to convert the value of$k
back to a string when it was a float / booleanAdditional context
phpDocumentor/phpDocumentor#2282
The text was updated successfully, but these errors were encountered: