Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Add types to public and protected properties#51069
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
derrabus left a comment
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.
Reviewing this PR is exhausting. I've reviewed up to the HttpFoundation component and will take a break now. 😓
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
55de9b0 tobd629d9Comparenicolas-grekas commentedJul 26, 2023
PR is ready for review. Needs#51121 to be 🍏 |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| protectedmixed$trueEquivalent =true; | ||
| protectedmixed$falseEquivalent =false; | ||
| protectedstring$pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR; | ||
| protectedNodeParentInterface|NodeInterface|null$parent; |
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.
The return type ofend() is wider. My gut feeling is that they should match.
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.
All those classes in the return type ofend() implementNodeParentInterface so we could reduce this to only it. I suppose the list is here to hint the IDE for autocompletion. Maybe we should keep onlyNodeParentInterface as native type and use@return for the rest?
The other strange thing is about the need to addNodeInterface to make this code work:
symfony/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php
Lines 352 to 361 in1935af6
| $node =newArrayNode($this->name,$this->parent,$this->pathSeparator); | |
| $this->validateConcreteNode($node); | |
| $node->setAddIfNotSet($this->addDefaults); | |
| foreach ($this->childrenas$child) { | |
| $child->parent =$node; | |
| $node->addChild($child->getNode()); | |
| } |
end() can't return anArrayNode because of its return type. Either the return type is wrong, or what?
Up to investigate and fix this on a lower branch?
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.
All those classes in the return type of
end()implementNodeParentInterfaceso we could reduce this to only it. I suppose the list is here to hint the IDE for autocompletion. Maybe we should keep onlyNodeParentInterfaceas native type and use@returnfor the rest?
Would work for me to unblock the PR.
Up to investigate and fix this on a lower branch?
Maybe, but not right away. 🙈
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.
use@return for the rest
PR updated
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.
The return type was not wrong. ArrayNode is not a NodeDefinition.
…. (nicolas-grekas)This PR was merged into the 6.4 branch.Discussion----------More short closures + isset instead of null checks + etc.| Q | A| ------------- | ---| Branch? | 6.4| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Some of the isset() checks are needed to make#51069 green on high-deps job.Commits-------3df6471 More short closures + isset instead of null checks + etc.
e3eabd6 to39b070cCompare2b8819e to6c5286fCompare
Uh oh!
There was an error while loading.Please reload this page.
🥵
Allowed by#45360
Follows#51068 and#51067