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] Add type-hints RequestContext and Route classes.#32181

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

Conversation

@derrabus
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#32179
LicenseMIT
Doc PRN/A

This PR adds type-hints toRequestContext and the Route classes to give them a more php7-like feeling. Adding these type-hints on master should not be a breaking change because we require php 7.2 there, which allows downstream classes/interfaces to remove a type-hint from a method signature.

@derrabusderrabusforce-pushed theimprovement/route-type-hints branch 2 times, most recently from6a69605 tocece78cCompareJune 26, 2019 07:58
@derrabusderrabus mentioned this pull requestJun 26, 2019
57 tasks
@derrabusderrabusforce-pushed theimprovement/route-type-hints branch fromcece78c tod321a1aCompareJune 27, 2019 21:04
* @param RouteCollectionBuilder $builder
*/
publicfunctionmount($prefix,self$builder)
publicfunctionmount(string$prefix,self$builder)
Copy link
Contributor

@TobionTobionJun 28, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

prefix is a string here but could also be null in

publicfunctionimport($resource, ?string$prefix ='/',string$type =null)
which would currently break.
but the prefix handling in this class seems strange anyway.mount will make the prefix an empty string when prefix is/ (the default). but in it checks for null. IMO the prefix should be initalized as string and then checked for'' instead.

but I would ask you to not add types in RouteCollectionBuilder because I proposed to deprecate it in#32240
this way we can merge this now and decide later if we need to worry about all those edge-cases

derrabus reacted with thumbs up emoji
Tobion added a commit that referenced this pull requestJun 28, 2019
…rrabus)This PR was merged into the 4.4 branch.Discussion----------[Routing] Deprecate RouteCollection::addPrefix(null)| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#32179| License       | MIT| Doc PR        | N/AThis PR deprecates the undocumented possibility to pass `null` as prefix to `RouteCollection::addPrefix()`. This allows us to add a `string` type-hint on the parameter in 5.0, see#32181 (comment)/cc@TobionCommits-------2a88752 [Routing] Deprecate RouteCollection::addPrefix(null).
@nicolas-grekasnicolas-grekas added this to the5.0 milestoneJun 28, 2019
@Tobion
Copy link
Contributor

Please rebase, remove deprecations and revert RouteCollectionBuilder

@derrabusderrabusforce-pushed theimprovement/route-type-hints branch fromd321a1a tobb0725fCompareJune 28, 2019 12:34
@derrabusderrabusforce-pushed theimprovement/route-type-hints branch frombb0725f to614e824CompareJune 28, 2019 12:36
@derrabus
Copy link
MemberAuthor

Done.

@Tobion
Copy link
Contributor

Thanks Alexander.

@TobionTobion merged commit614e824 intosymfony:masterJun 28, 2019
Tobion added a commit that referenced this pull requestJun 28, 2019
…s. (derrabus)This PR was merged into the 5.0-dev branch.Discussion----------[Routing] Add type-hints RequestContext and Route classes.| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#32179| License       | MIT| Doc PR        | N/AThis PR adds type-hints to `RequestContext` and the Route classes to give them a more php7-like feeling. Adding these type-hints on master should not be a breaking change because we require php 7.2 there, which allows downstream classes/interfaces to remove a type-hint from a method signature.Commits-------614e824 [Routing] Add type-hints RequestContext and Route classes.
@derrabusderrabus deleted the improvement/route-type-hints branchJune 28, 2019 13:35
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.0

Development

Successfully merging this pull request may close these issues.

4 participants

@derrabus@Tobion@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp