Skip to content

Add missing RuntimeExtensionInterface #10025

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

Closed
wants to merge 3 commits into from
Closed

Conversation

tjamps
Copy link
Contributor

@tjamps tjamps commented Jul 5, 2018

If the Twig runtime class does not implement RuntimeExtensionInterface, the autoconfigure feature of the container will not tag it with twig.runtime, and an exception will be thrown ("Unable to load the "App\Twig\AppRuntime" runtime.")

If the Twig runtime class does not implement RuntimeExtensionInterface, the autoconfigure feature of the container will not tag it with `twig.runtime`, and an exception will be thrown ("Unable to load the "App\Twig\AppRuntime" runtime.")
@@ -117,8 +117,10 @@ previous ``priceFilter()`` method::

// src/Twig/AppRuntime.php
namespace App\Twig;

use use Twig\Extension\RuntimeExtensionInterface;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@javiereguiluz
Copy link
Member

Rémi, thanks for fixing this issue in the example code ... and congrats on your first contribution to Symfony Docs! We merged it in 3.4 and later we'll merge it in the other branches automatically.

javiereguiluz added a commit that referenced this pull request Jul 6, 2018
…iluz)

This PR was submitted for the 4.1 branch but it was merged into the 3.4 branch instead (closes #10025).

Discussion
----------

Add missing RuntimeExtensionInterface

If the Twig runtime class does not implement RuntimeExtensionInterface, the autoconfigure feature of the container will not tag it with `twig.runtime`, and an exception will be thrown ("Unable to load the "App\Twig\AppRuntime" runtime.")

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

4e9b044 Added the missing versionadded directive
cb102c1 Remove duplicate `use` keyword
0e8d863 Add missing RuntimeExtensionInterface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants