-
-
Couldn't load subscription status.
- Fork 9.7k
[Config] Deprecate setting a default value to a node that is required #62090
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
GromNaN
commented
Oct 16, 2025
| Q | A |
|---|---|
| Branch? | 7.4 |
| Bug fix? | no |
| New feature? | no |
| Deprecations? | yes |
| Issues | Fix #62076 |
| License | MIT |
3afbdb8 to
5cef122
Compare
|
|
||
| public function testUnknownPackageThrowsException() | ||
| { | ||
| $node = new ArrayNodeDefinition('node'); |
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.
Moving expectException just before the call that produces it to be more specific.
| yield [ArrayNodeDefinition::class, []]; | ||
| yield [ScalarNodeDefinition::class, null]; | ||
| yield [BooleanNodeDefinition::class, false]; | ||
| yield [StringNodeDefinition::class, 'default']; | ||
| yield [VariableNodeDefinition::class, '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.
Testing various child classes as they could have different behaviors.
5cef122 to
e3e3c1c
Compare
9549b89 to
e19d3ed
Compare
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
e19d3ed to
8a1bb6d
Compare
8a1bb6d to
5a47df9
Compare
|
I updated the messages of the deprecation and the future exceptions. |
| ------ | ||
|
|
||
| * Deprecate accessing the internal scope of the loader in PHP config files, use only its public API instead | ||
| * Deprecate setting a default value to a node that is required, and vice versa |
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.
| * Deprecate setting a default value to a node that is required, and vice versa | |
| * Deprecate setting a default value to a node that is required |
I think it's understandable like 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.
Sorry I missed your comment and merged.
I used a different wording for the 8.0 branch: #62109
…isRequired()` and `defaultValue()` (GromNaN) This PR was merged into the 8.0 branch. Discussion ---------- [Config] Ensure configuration nodes do not have both `isRequired()` and `defaultValue()` | Q | A | ------------- | --- | Branch? | 8.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix #62076 | License | MIT Convert deprecation introduced in #62090 into an exception. Commits ------- 59f69e0 [Config] Ensure configuration nodes does not have both isRequired() and defaultValue()
…isRequired()` and `defaultValue()` (GromNaN) This PR was merged into the 8.0 branch. Discussion ---------- [Config] Ensure configuration nodes do not have both `isRequired()` and `defaultValue()` | Q | A | ------------- | --- | Branch? | 8.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix symfony/symfony#62076 | License | MIT Convert deprecation introduced in symfony/symfony#62090 into an exception. Commits ------- 59f69e0127b [Config] Ensure configuration nodes does not have both isRequired() and defaultValue()