Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] Add--method option todebug: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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

santysisi
Copy link
Contributor

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
IssuesFeature#59906
LicenseMIT

Description

I have added a newInputOption 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

  • 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

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

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

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!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@OskarStarkOskarStark changed the title[FrameworkBundle] Add new InputOption 'method' to debug:router command[FrameworkBundle] Add--method option todebug:router commandMar 5, 2025
@santysisisantysisiforce-pushed thefeature_add-http-method-filter-to-debug-router branch from2c1095c toe2d90faCompareMarch 5, 2025 14:27
@santysisisantysisiforce-pushed thefeature_add-http-method-filter-to-debug-router branch frome2d90fa toca61a87CompareMarch 6, 2025 21:53
@santysisisantysisi requested a review frommtarldMarch 6, 2025 22:03
@santysisi
Copy link
ContributorAuthor

Hi 😃, I hope you're doing well!
I wanted to check if any further changes are needed in the PR, or if it's good to go for merging 🎉🎉🎉
Thanks a lot in advance, and I look forward to your response!

Copy link
Contributor

@mtarldmtarld left a 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 😉

santysisi reacted with heart emoji
@santysisisantysisiforce-pushed thefeature_add-http-method-filter-to-debug-router branch fromca61a87 to3d9c69dCompareMarch 11, 2025 13:38
Copy link
Member

@chalasrchalasr left a 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.

santysisi reacted with heart emoji
@santysisi
Copy link
ContributorAuthor

Congrats on your great first PR to Symfony.

Thank you very much, I'm very excited 😄

Comment on lines 379 to 382
if (
$route->getMethods()
&& !\in_array($method, $route->getMethods(), true)
) {
Copy link
Contributor

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

mtarld reacted with thumbs up emojisantysisi reacted with heart emoji
Comment on lines 142 to 145
if (
false !== stripos($routeName, $name)
&& (null === $method || !$route->getMethods() || \in_array($method, $route->getMethods(), true))
) {
Copy link
Contributor

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

santysisi reacted with heart emoji
@nicolas-grekasnicolas-grekasforce-pushed thefeature_add-http-method-filter-to-debug-router branch from3d9c69d to6a98d49CompareMarch 13, 2025 14:16
@nicolas-grekas
Copy link
Member

Thank you@santysisi.

santysisi reacted with heart emoji

@nicolas-grekasnicolas-grekas merged commit6c0058a intosymfony:7.3Mar 13, 2025
11 checks passed
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@OskarStarkOskarStarkOskarStark approved these changes

@mtarldmtarldmtarld approved these changes

@chalasrchalasrchalasr approved these changes

@alexandre-dauboisalexandre-dauboisAwaiting requested review from alexandre-daubois

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

7 participants
@santysisi@carsonbot@nicolas-grekas@OskarStark@alexandre-daubois@mtarld@chalasr

[8]ページ先頭

©2009-2025 Movatter.jp