Skip to content
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

Add RouteCollectionInterface #6699

Merged

Conversation

franmomu
Copy link
Member

Subject

Related #6698

This interface was added in 4.x branch, this commit imports it removing type and return declarations to make it compatible with RouteCollection which implements this interface.

In sonata 4 AbstractAdmin::configureRoutes() method receives a RouteCollectionInterface, importing this interface in 3.x would allow users to update their code and define this method as in 4, easing the upgrading process.

This would only work for users with PHP >= 7.4 because contravariance was fully support since that version, to me this is fine, but we could remove AbstractAdmin::configureRoutes() and AdminExtensionInterface::configureRoutes() methods and add some method_exists checks and reintroduce these methods in 4.x branch.

I am targeting this branch, because these changes are BC.

Closes #6698.

Changelog

### Added
- Added `RouteCollectionInterface` imported from `4.x` to ease upgrading process.

This interface was added in 4.x branch, this commit imports it
removing type and return declarations to make it compatible with
RouteCollection which implements this interface.

In sonata 4 AbstractAdmin::configureRoutes() method receives a
RouteCollectionInterface, importing this interface in 3.x would
allow users to update their code and define this method as in 4
easing the upgrading process.
@franmomu franmomu added the minor label Dec 11, 2020
VincentLanglet
VincentLanglet previously approved these changes Dec 11, 2020
@VincentLanglet VincentLanglet requested a review from a team December 11, 2020 23:19
@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@VincentLanglet VincentLanglet added this to the 4.0 milestone Dec 23, 2020
wbloszyk
wbloszyk previously approved these changes Dec 23, 2020
@VincentLanglet VincentLanglet dismissed stale reviews from wbloszyk and themself via 75fb405 December 24, 2020 15:24
@VincentLanglet VincentLanglet merged commit 434b1c3 into sonata-project:3.x Dec 24, 2020
@VincentLanglet
Copy link
Member

Thanks @franmomu

@franmomu franmomu deleted the import_router_collection_interface branch March 19, 2021 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import RouteCollectionInterface from 4.x into 3.x
4 participants