Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
nicolas-grekas merged 1 commit intosymfony:7.0fromnicolas-grekas:typed-props
Jul 28, 2023

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedJul 21, 2023
edited
Loading

QA
Branch?7.0
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

🥵

Allowed by#45360

Follows#51068 and#51067

Copy link
Member

@derrabusderrabus left a 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. 😓

@nicolas-grekas
Copy link
MemberAuthor

PR is ready for review. Needs#51121 to be 🍏

protectedmixed$trueEquivalent =true;
protectedmixed$falseEquivalent =false;
protectedstring$pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR;
protectedNodeParentInterface|NodeInterface|null$parent;
Copy link
Member

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.

Copy link
MemberAuthor

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:

$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?

Copy link
Member

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?

Would work for me to unblock the PR.

Up to investigate and fix this on a lower branch?

Maybe, but not right away. 🙈

Copy link
MemberAuthor

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

Copy link
Member

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 added a commit that referenced this pull requestJul 27, 2023
…. (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.
@nicolas-grekasnicolas-grekasforce-pushed thetyped-props branch 3 times, most recently frome3eabd6 to39b070cCompareJuly 27, 2023 07:52
nicolas-grekas added a commit that referenced this pull requestJul 27, 2023
This PR was merged into the 6.4 branch.Discussion----------Ensure all properties have a type| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -Before#51069Commits-------25a8615 Ensure all properties have a type
@nicolas-grekasnicolas-grekasforce-pushed thetyped-props branch 2 times, most recently from2b8819e to6c5286fCompareJuly 27, 2023 11:19
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@derrabusderrabusderrabus approved these changes

@OskarStarkOskarStarkAwaiting requested review from OskarStarkOskarStark is a code owner

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

@lyrixxlyrixxAwaiting requested review from lyrixxlyrixx is a code owner

@wouterjwouterjAwaiting requested review from wouterj

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

+1 more reviewer

@94noni94noni94noni left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.0

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@stof@94noni@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp