-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add PSR-11 compatible ContainerRuntimeLoader #2401
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
Conversation
lib/Twig/ContainerRuntimeLoader.php
Outdated
| } | ||
|
|
||
| if (null !== $this->logger) { | ||
| $this->logger->warning(sprintf('Class "%s" is not configured as a Twig runtime service.', $class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should keep this logging call. If another loader is able to load the runtime, this is just spamming logs (especially at warning level). and if no loader can load it, Twig_Environment::getRuntime throws an exception with a meaningful message already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, removed the logger dependency.
5bcfc96 to
b129065
Compare
lib/Twig/ContainerRuntimeLoader.php
Outdated
| use Psr\Container\ContainerInterface; | ||
|
|
||
| /** | ||
| * Lazily loads Twig runtime implementations from a container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say from a PSR-11 container.
And the long description of the class should explain that it expects being able to use the runtime class as an identifier in the container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
b129065 to
5940d5f
Compare
|
Should be for the 1.x branch in which we still can add new features (as long as they don't break BC of course as we cannot add new deprecation notices). |
5940d5f to
964a51b
Compare
|
Rebased! |
|
I will take care of bumping the version when merging. |
|
Thank you @chalasr. |
This PR was merged into the 1.x branch. Discussion ---------- Add ContainerRuntimeLoader Next to symfony/symfony#21625 (comment) Commits ------- 964a51b Add ContainerRuntimeLoader
Next to symfony/symfony#21625 (comment)