Permalink
Browse files

feature #23037 [TwigBundle] Added a RuntimeExtensionInterface to take…

… advantage of autoconfigure (lyrixx)

This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] Added a RuntimeExtensionInterface to take advantage of autoconfigure

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | - (asked by @nicolas-grekas)
| License       | MIT
| Doc PR        | -

---

Before:

```yaml
#app/config/services.yml
services:
    _defaults:
        autoconfigure: true

    AppBundle\Twig\HelloExtension:
        tags: ['twig.runtime']
```

After:

```yaml
#app/config/services.yml
services:
    _defaults:
        autoconfigure: true

#Yes, there are nothing anymore
```

Commits
-------

ba8763b [TwigBundle] Added a RuntimeExtensionInterface to take advantage of autoconfigure
  • Loading branch information...
nicolas-grekas committed Jul 12, 2017
2 parents 66ead2e + ba8763b commit 954e9f13c566f484131a45e2c3301ef44ad3c228
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
@@ -19,6 +19,7 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\WebLink\HttpHeaderSerializer;
use Twig\Extension\ExtensionInterface;
use Twig\Extension\RuntimeExtensionInterface;
use Twig\Loader\LoaderInterface;
/**
@@ -150,6 +151,7 @@ public function load(array $configs, ContainerBuilder $container)
$container->registerForAutoconfiguration(\Twig_LoaderInterface::class)->addTag('twig.loader');
$container->registerForAutoconfiguration(ExtensionInterface::class)->addTag('twig.extension');
$container->registerForAutoconfiguration(LoaderInterface::class)->addTag('twig.loader');
$container->registerForAutoconfiguration(RuntimeExtensionInterface::class)->addTag('twig.runtime');
if (\PHP_VERSION_ID < 70000) {
$this->addClassesToCompile(array(

0 comments on commit 954e9f1

Please sign in to comment.