-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Add --method
option to debug:router
command
#59909
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
[FrameworkBundle] Add --method
option to debug:router
command
#59909
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
--method
option to debug:router
command
src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
Outdated
Show resolved
Hide resolved
2c1095c
to
e2d90fa
Compare
src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
Show resolved
Hide resolved
e2d90fa
to
ca61a87
Compare
Hi 😃, I hope you're doing well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good to me 😉
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
Outdated
Show resolved
Hide resolved
ca61a87
to
3d9c69d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on your great first PR to Symfony.
Thank you very much, I'm very excited 😄 |
if ( | ||
$route->getMethods() | ||
&& !\in_array($method, $route->getMethods(), true) | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symfony usually prefers one liners to ease merging
if ( | ||
false !== stripos($routeName, $name) | ||
&& (null === $method || !$route->getMethods() || \in_array($method, $route->getMethods(), true)) | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symfony usually prefers one liners to ease merging
3d9c69d
to
6a98d49
Compare
Thank you @santysisi. |
Description
I have added a new
InputOption
namedmethod
to thedebug:router
command. This option allows developers to filter the displayed routes by HTTP method (GET, POST, PUT, DELETE, etc.) when running the command. This improvement makes it easier and more efficient to debug routes, especially in large applications. It also aligns thedebug:router
command with therouter:match
command, which already includes a similar option for filtering by HTTP method.Changes Made
Example
Before adding the new InputOption:
php bin/console debug:router
After adding the new InputOption:
php bin/console debug:router --method=GET
Before adding the new InputOption with the name argument
php bin/console debug:router app_foo
After adding the method InputOption with the name argument:
php bin/console debug:router app_foo --method=DELETE