phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

verify that path used in twig actually exist

Open landsman opened this issue 10 months ago • 2 comments

When this extension learn to operate with twig it would be nice to add rule where we can check generated routes agains paths in twig.

<a href="{{ path('some_missing_page') }}">

That would help me a lot on some old projects with checking PRs.

landsman avatar Jan 20 '25 13:01 landsman

This can be done by creating a custom Node rule for Twig CS Fixer, see: https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/custom.md#node-based-rules

ruudk avatar Jan 20 '25 13:01 ruudk

This would actually be a good rule for https://github.com/twigstan/twigstan once #428 is implemented in this extension

stof avatar Mar 19 '25 17:03 stof