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
[Routing] Add type-hints to all public interfaces #32176
[Routing] Add type-hints to all public interfaces #32176
Conversation
17a86c9
to
457b322
Compare
Thank you @derrabus. |
…bus) This PR was merged into the 5.0-dev branch. Discussion ---------- [Routing] Add type-hints to all public interfaces | 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/A This PR adds type-hints to all interfaces of the Routing component 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. Notes: * There is also an implementation of `RedirectableUrlMatcherInterface` in the Framework Bundle. I did not upgrade its interface in order to keep the bundle compatible with Routing 4.4. * We could apply similar changes to the `Route`, `RouteCollection` etc. in a follow-up PR. This PR only concentrated on the interfaces and their implementations. Commits ------- 457b322 [Routing] Add type-hints to all public interfaces.
This PR was merged into the 3.4 branch. Discussion ---------- [Routing] Fixed type annotation | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A The `UrlGeneratorInterface::generate()` method expects an array as argument `$parameters`, but the docblock does not reflect that. This PR fixes the type. Discovered while working on #32176. Commits ------- 753bf7e Fixed type annotation.
On #32185 @Tobion pointed out that Should we reconsider the array type-hint I've added there? I would argue that A custom implementation of WDYT? Keep the type-hint or drop it? |
This PR adds type-hints to all interfaces of the Routing component 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.
Notes:
RedirectableUrlMatcherInterface
in the Framework Bundle. I did not upgrade its interface in order to keep the bundle compatible with Routing 4.4.Route
,RouteCollection
etc. in a follow-up PR. This PR only concentrated on the interfaces and their implementations.