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

[Routing] adding typehint to some functions and parameters#51005

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

Closed

Conversation

@helyakin
Copy link

QA
Branch?6.4
Bug fix?no
New feature?no
Deprecations?no

So i was walking around the Routing component for diverse reasons, and I came across some not type hinted:

  • Function
  • Parameter

I've also taken the freedom to add the property accessibility into the constructor since we are using php81

I have absolutely no idea if this PR is welcome, as this might be something you would not want to add to this framework for now.

Feel free to share your thoughts and opinions about this PR, I'll gladly learn whatever you might say about it !

Thanks again for your time

jeremyFreeAgent reacted with eyes emoji
@wouterj
Copy link
Member

Hi!

Adding a return type is a backwards compatibility break for child classes overriding this method. In 6.4, all methods have either a PHP return type or an@return PHPdoc (#47551,#50821). This results in a deprecation notices when you override a method without adding the correct PHP return type. In 7.0, we've added all missing return types (#50852,#50846) - except from some that we want to extend for another 2 years to avoid a big burden on the community.

For the same reasons, we've also limited property types to private or internal properties, or properties on final or internal classes (see#41924 for a bit more context).

Finally, I'm not sure what our policy is with CPP. I'm not too fond of it, as it's merely syntax sugar and can cause edge-case BC breaks as well:#45721 (comment)

@nicolas-grekas
Copy link
Member

Closing as explained by@wouterj, thanks for proposing.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

4 participants

@helyakin@wouterj@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp