Skip to content

Instantly share code, notes, and snippets.

View malteschlueter's full-sized avatar

Malte Schlüter malteschlueter

View GitHub Profile
@malteschlueter
malteschlueter / RouterMismatchCommand-README.md
Last active July 1, 2022 11:32
This Symfony command can help you identify mismatched routes. For example, if you migrate the route configuration from YAML to Annotation and the routes do not work correctly afterwards.

RouterMismatchCommand

This Symfony command can help you identify mismatched routes. For example, if you migrate the route configuration from YAML to Annotation and the routes do not work correctly afterwards.

One reason why the routes do not work correctly could be that the controller methods are not in the correct order like the YAML configuration was.

How to use the command

Just copy the RouterMismatchCommand.php into your project and execute it. If you have a mismatched route it will display it in a table.

For me it was sufficient to move the controller method with the route app_foo_staticroute before the method with the route app_foo_paramroute. If you're using Symfony >=5.1 you can use the priority parameter.

@malteschlueter
malteschlueter / intellij-generate-random-uuids-without-plugins.md
Last active December 21, 2023 11:38
IntelliJ (i.e. PhpStorm): Generate random UUIDs without plugins

IntelliJ (i.e. PhpStorm): Generate random UUIDs without plugins

You can generate random UUIDs without plugins in PhpStorm or other IntelliJ applications.

  1. Open PhpStorm Settings
  2. Go to Editor > Live Templates
  3. Expand the PHP section
  4. Click on the Add button, + on the right side, and select Live template
  5. In the abbreviation field, enter uuid. This is what we'll type to expand the template
  6. In the template text field, enter $VALUE$