Skip to content

Instantly share code, notes, and snippets.

@xeptore
Created August 21, 2018 13:29
Show Gist options
  • Save xeptore/fd03eb906b7f39589d16a05e9d00634d to your computer and use it in GitHub Desktop.
Save xeptore/fd03eb906b7f39589d16a05e9d00634d to your computer and use it in GitHub Desktop.
a list of more useful symfony cli commands

Debug the Service Container & List Services

To get a list of all services (public and private) and their PHP classes:

php bin/console debug:container

To get a list of hidden services:

php bin/console debug:container --show-hidden

To show a list of all of the available types that can be used for autowiring (in case of App\Service\Mailer):

php bin/console debug:autowiring

To get more detailed information about a particular service by specifying its id (in case of App\Service\Mailer):

php bin/console debug:container 'App\Service\Mailer'

To show the service arguments (in case of App\Service\Mailer):

php bin/console debug:container 'App\Service\Mailer' --show-arguments

Debugging Event Listeners

To show all events and their listeners:

php bin/console debug:event-dispatcher

Get registered listeners for a particular event by specifying its name (in case of kernel.exception):

php bin/console debug:event-dispatcher kernel.exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment