Twig
Twig copied to clipboard
Can we detect dump function
Hi,
often i forget to delete dump functions in twig templates. Is there a way to detect them and use this in a prehook in git?
See you Roland
If you use Symfony, you could run the lint:twig command in the prod environment which should error when the dump() function is used but not defined (which should be the case in the prod environment).
So maybe this is a feature request ;) Or should we close it?
A feature request is not necessary since @xabbuh has shown a way to detect a dump() call. Just use php bin/console lint:twig templates --env=prod in the CLI.
I'm running into something when I try that:
bin/console lint:twig templates/ --env=prod
In Container.php line 264:
You have requested a non-existent service "debug.error_handler_configurator".
Any ideas? I can't tell what that's related to. It happens when I try to clear the cache too.
@tacman might be fixed by symfony/symfony#50498 (which was not released yet)