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

Remove non-routes from route:list #1304

Closed
galdiuz opened this issue Sep 25, 2023 · 1 comment
Closed

Remove non-routes from route:list #1304

galdiuz opened this issue Sep 25, 2023 · 1 comment
Assignees
Milestone

Comments

@galdiuz
Copy link

galdiuz commented Sep 25, 2023

Current Implementation

The route:list command currently uses \Magento\Framework\Module\Dir\Reader->getActionFiles() to find classes in every module's Controller directory. However, all of these classes don't actually represent an actual route, as there can be things like abstract classes, interfaces, or just plain non-action classes.

Suggested Enhancement

Check each class before including it. This can be done at the start of the foreach in ListCommand.php. Using is_a($fullActionPath, '\Magento\Framework\App\ActionInterface', true) to check if the class implements ActionInterface would catch all non-action classes, then reflection could be used to also catch any abstract classes.

Expected Benefits

route:list would no longer list results that are not accessible paths.

@cmuench
Copy link
Member

cmuench commented Dec 16, 2023

Will be released with v7.3.0

@cmuench cmuench closed this as completed Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants