WouterJEloquentBundle icon indicating copy to clipboard operation
WouterJEloquentBundle copied to clipboard

Warning in service wiring because of missing "Twig_Environment"

Open brzuchal opened this issue 2 years ago • 1 comments

I use Symfony Framerowk but no Twig, so I get this warning:

Warning: Class "Twig_Environment" not found in .../vendor/wouterj/eloquent-bundle/src/Twig/SqlFormatterExtension.php on line 18

The above-mentioned SqlFormatterExtension should be wired only if there is a presence of Twig being detected first. No need for this in applications that don't have HTML rendering.\


Using the latest version 2.2.1

brzuchal avatar Jun 05 '22 16:06 brzuchal

Hi! Can you share in which scenario you get this warning? The service should not be used when there is no WebProfilerBundle (and this bundle requires Twig to be installed), and unused services don't produce warnings IIRC.

As a test, I just did this and got no warning:

symfony new reproducer
cd reproducer/
composer require wouterj/eloquent-bundle
bin/console lint:container

wouterj avatar Jun 09 '22 21:06 wouterj

@wouterj the lint:container doesn't show anything unusual, but when you run bin/console debug:container --no-debug --format=json you get the fatal error.

brzuchal avatar Dec 09 '22 11:12 brzuchal

@wouterj any solutions for this?! I still get it on v2.3.

brzuchal avatar Mar 20 '23 13:03 brzuchal