-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] Fix using null values with config builders #45789
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
Conversation
*/ | ||
class ReceivingConfig | ||
{ | ||
private $priority; | ||
private $color; | ||
private $_usedProperties = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use underscores in property names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas This is to avoid collision with configuration proprieties (->scalarNode('used_properties')
), same as with _extraKeys
.
Sorry, I accidentally resolved this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the explanation.
$this->scalarNode = $value['scalar_node']; | ||
unset($value['scalar_node']); | ||
} | ||
|
||
if (isset($value['scalar_node_with_default'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this use array_key_exists
to allow passing null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof Yep, missed that one, tnx. Fixed https://github.com/symfony/symfony/compare/e214761c573ecc980b5d1b5e3c4dff12f8a6933d..1264225f4ebc535deec491737b70d9bc1d84dc98
e214761
to
1264225
Compare
Thank you @HypeMC. |
The generated config builders will no longer discard
null
values.