Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning in service wiring because of missing "Twig_Environment" #130

Closed
brzuchal opened this issue Jun 5, 2022 · 3 comments · Fixed by #134
Closed

Warning in service wiring because of missing "Twig_Environment" #130

brzuchal opened this issue Jun 5, 2022 · 3 comments · Fixed by #134

Comments

@brzuchal
Copy link
Contributor

brzuchal commented Jun 5, 2022

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

@wouterj
Copy link
Owner

wouterj commented Jun 9, 2022

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

@brzuchal
Copy link
Contributor Author

brzuchal commented Dec 9, 2022

@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
Copy link
Contributor Author

brzuchal commented Mar 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants