8000 [FrameworkBundle] Add new InputOption 'method' to debug:router command · Issue #59906 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Add new InputOption 'method' to debug:router command #59906

New issue

8000 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

Closed
santysisi opened this issue Mar 3, 2025 · 0 comments
Closed

Comments

@santysisi
Copy link
Contributor

Description

It might be useful to add a new InputOption named "method" to the debug:router command. This option would allow developers to filter the displayed routes by HTTP method (GET, POST, PUT, DELETE, etc.) when running the command. This would make debugging routes a bit easier and more efficient, especially when working with large applications. Additionally, it would bring the debug:router command in line with the router:match command, which already has a similar option for filtering by method.

If this feature aligns with the goals of Symfony, I would be happy to open a PR for the 7.3 branch.

Example

Before adding the new InputOption:
php bin/console debug:router

Image

After adding the new InputOption:
php bin/console debug:router --method=GET

Image

Before adding the new InputOption with the name argument
php bin/console debug:router app_foo

Image

After adding the method InputOption with the name argument:
php bin/console debug:router app_foo --method=DELETE

Image

nicolas-grekas added a commit that referenced this issue Mar 13, 2025
…er` command (santysisi)

This PR was merged into the 7.3 branch.

Discussion
----------

[FrameworkBundle] Add `--method` option to `debug:router` command

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        |  Feature #59906
| License       | MIT

### Description

I have added a new `InputOption` named `method` to the `debug: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 the `debug:router` command with the `router:match` command, which already includes a similar option for filtering by HTTP method.

### Changes Made
* Added the --method option to the debug:router command.
* Routes can now be filtered based on the HTTP method used (GET, POST, PUT, DELETE, etc.).
* This enhances debugging capabilities and streamlines the process of working with specific route methods.

### Example

Before adding the new InputOption:
`php bin/console debug:router`

![Image](https://github.com/user-attachments/assets/c8e4fe51-0ba0-46dc-8369-2bc156873b2d)

After adding the new  InputOption:
`php bin/console debug:router --method=GET`

![Image](https://github.com/user-attachments/assets/5edcee2f-8761-4af9-919a-a741d6024e51)

Before adding the new InputOption with the name argument
`php bin/console debug:router app_foo`

![Image](https://github.com/user-attachments/assets/16470489-acba-49c2-8fe0-fd856702d052)

After adding the method InputOption with the name argument:
php bin/console debug:router app_foo --method=DELETE

![Image](https://github.com/user-attachments/assets/419b739f-794b-4427-9c8d-64babaaa4245)

Commits
-------

6a98d49 Add 'method' option to debug:router command to filter routes by HTTP method
javiereguiluz added a commit to symfony/symfony-docs that referenced this issue Mar 18, 2025
…n for filtering routes (santysisi)

This PR was merged into the 7.3 branch.

Discussion
----------

[Routing] Add new tip to explain usage of --method option for filtering routes

This PR updates the documentation for the debug:router command to include the new --method option, which allows developers to filter routes by HTTP method (such as GET, POST, PUT, DELETE, etc.). This enhances the debug:router command, making it easier to focus on specific routes based on their HTTP method, especially in large applications.

For more context, refer to the original issue: [Symfony Issue #59906](symfony/symfony#59906).

Commits
-------

b04bc3a Add new tip to explain usage of --method option for filtering routes
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

4 participants
0