Skip to content

Commit 9604573

Browse files
committed
[TwigBundle] removed the extensions setting
1 parent afa30d9 commit 9604573

File tree

6 files changed

+4
-32
lines changed

6 files changed

+4
-32
lines changed

UPDATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ timeline closely anyway.
99
beta4 to beta5
1010
--------------
1111

12+
* The `extensions` setting for Twig has been removed. There is now only one
13+
way to register Twig extensions, via the `twig.extension` tag.
14+
1215
* The stack of Monolog handlers now bubbles the records by default. To stop
1316
the propagation you need to configure the bubbling explicitly.
1417

src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,13 @@ public function getConfigTreeBuilder()
3232
$treeBuilder = new TreeBuilder();
3333
$rootNode = $treeBuilder->root('twig');
3434

35-
$this->addExtensionsSection($rootNode);
3635
$this->addFormSection($rootNode);
3736
$this->addGlobalsSection($rootNode);
3837
$this->addTwigOptions($rootNode);
3938

4039
return $treeBuilder;
4140
}
4241

43-
private function addExtensionsSection(ArrayNodeDefinition $rootNode)
44-
{
45-
$rootNode
46-
->fixXmlConfig('extension')
47-
->children()
48-
->arrayNode('extensions')
49-
->prototype('scalar')->end()
50-
->end()
51-
->end()
52-
;
53-
}
54-
5542
private function addFormSection(ArrayNodeDefinition $rootNode)
5643
{
5744
$rootNode

src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ public function load(array $configs, ContainerBuilder $container)
5555
}
5656
}
5757

58-
if (!empty($config['extensions'])) {
59-
foreach ($config['extensions'] as $id) {
60-
$container->getDefinition($id)->addTag('twig.extension');
61-
}
62-
}
63-
6458
unset(
6559
$config['form'],
6660
$config['globals'],

src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
<parameter key="twig.extension.routing.class">Symfony\Bridge\Twig\Extension\RoutingExtension</parameter>
1717
<parameter key="twig.extension.yaml.class">Symfony\Bridge\Twig\Extension\YamlExtension</parameter>
1818
<parameter key="twig.extension.form.class">Symfony\Bridge\Twig\Extension\FormExtension</parameter>
19-
<parameter key="twig.extension.text.class">Twig_Extensions_Extension_Text</parameter>
20-
<parameter key="twig.extension.debug.class">Twig_Extensions_Extension_Debug</parameter>
2119
</parameters>
2220

2321
<services>
@@ -76,9 +74,5 @@
7674
<tag name="twig.extension" />
7775
<argument>%twig.form.resources%</argument>
7876
</service>
79-
80-
<service id="twig.extension.text" class="%twig.extension.text.class%" public="false" />
81-
82-
<service id="twig.extension.debug" class="%twig.extension.debug.class%" public="false" />
8377
</services>
8478
</container>

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ public function testLoadFullConfiguration($format)
5252

5353
$this->assertEquals('Twig_Environment', $container->getParameter('twig.class'), '->load() loads the twig.xml file');
5454

55-
// Extensions
56-
foreach (array('twig.extension.debug', 'twig.extension.text') as $id) {
57-
$config = $container->getDefinition($id);
58-
$this->assertEquals(array('twig.extension'), array_keys($config->getTags()), '->load() adds tags to extension definitions');
59-
}
60-
6155
// Form resources
6256
$resources = $container->getParameter('twig.form.resources');
6357
$this->assertContains('div_layout.html.twig', $resources, '->load() includes default template for form resources');

src/Symfony/Component/Form/Extension/Core/Type/FileType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function buildViewBottomUp(FormView $view, FormInterface $form)
4848
public function getDefaultOptions(array $options)
4949
{
5050
return array(
51-
'type' => 'file',
51+
'type' => 'string',
5252
);
5353
}
5454

0 commit comments

Comments
 (0)