8000 Command `debug:router --no-interaction` fails when several route match · Issue #45777 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Command debug:router --no-interaction fails when several route match #45777
Closed
@GromNaN

Description

@GromNaN

Symfony version(s) affected

4.4+

Description

There is a fatal error when command debug:router is used in non-interactive mode, with a name that matches more than 1 route.

How to reproduce

$ bin/console debug:router _profiler_ --no-interaction 

In RouteCollection.php line 130:
                                                                                                                                                                                                                                  
  Symfony\Component\Routing\RouteCollection::get(): Argument #1 ($name) must be of type string, null given, called in vendor/symfony/framework-bundle/Command/Router  
  DebugCommand.php on line 98                                                                                                                                                                                                     
                                                                                                                                                                                                                                  

debug:router [--show-controllers] [--format FORMAT] [--raw] [--] [<name>]

Possible Solution

2 ways to handle this path:

  1. Show the list of route that match with an error message (exit code != 0)
  2. Render the list, like if the name argument was not provided, but filtered.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0