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 SymfonyCmfRouteObjectInterfaceConstantsRule #445

Merged
merged 3 commits into from
Jul 13, 2022
Merged

Add SymfonyCmfRouteObjectInterfaceConstantsRule #445

merged 3 commits into from
Jul 13, 2022

Conversation

mglaman
Copy link
Owner

@mglaman mglaman commented Jul 13, 2022

Fixes #440

@larowlan
Copy link
Contributor

This seems to be catching all uses of \Traversable and reporting them as deprecated, to be replaced with LazyRouteCollection

Return type of method Drupal\my_module\MyClass::getIterator() has  
         typehint with deprecated Traversable and is removed in Drupal 10. Use           
         \Drupal\Core\Routing\LazyRouteCollection instead.                               
         💡 Change record: https://www.drupal.org/node/3151009       

@larowlan
Copy link
Contributor

It also seems to be recommending using core's LazyRouteCollection over the symfony RouteCollection (not the symfony-cmf one, the symfony/routing one)

Return type of method                                                                 
         Drupal\my_module\EntityHandlers\MyRoutingProvider::getRoutes() has         
         typehint with deprecated Symfony\Component\Routing\RouteCollection and is removed in  
         Drupal 10. Use \Drupal\Core\Routing\LazyRouteCollection instead.                      
         💡 Change record: https://www.drupal.org/node/3151009 

@mglaman
Copy link
Owner Author

mglaman commented Jul 14, 2022

Oh crud. I need to improve the test coverage. The CR recommended the core route collection class

@mglaman
Copy link
Owner Author

mglaman commented Jul 14, 2022

@larowlan pushing hotfix patch release which switches to equals vs isSuperOf. This fixes the RouteCollection issue as well (\Symfony\Cmf\Component\Routing\LazyRouteCollection extends it, so superOf was yes.) Same with RouteProvider.

@larowlan
Copy link
Contributor

Thanks for the fast turnaround, cc @acbramley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RouteObjectInterface does not exist in D10
2 participants