From c61de22b2234ee8a94b35d8497e2636941d33612 Mon Sep 17 00:00:00 2001 From: Peter Rehm Date: Thu, 11 Jun 2015 21:02:14 -0400 Subject: [PATCH] Removed templating.helper.assets service configuration --- UPGRADE-3.0.md | 4 ++-- .../DependencyInjection/FrameworkExtension.php | 6 ------ .../Resources/config/templating_php.xml | 6 ------ .../Fixtures/php/assets_disabled.php | 7 ------- .../FrameworkExtensionTest.php | 15 --------------- 5 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index c20bb51c579a6..59cf034618aa4 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -353,9 +353,9 @@ UPGRADE FROM 2.x to 3.0 * The `request` service was removed. You must inject the `request_stack` service instead. - * The `templating.helper.assets` was moved to `templating_php.xml`. You can + * The `templating.helper.assets` was removed in Symfony 3.0. You should use the `assets.package` service instead. - + Before: ```php diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 6f756b8a4f985..01e04adc68305 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -557,12 +557,6 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB 'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', )); - - if ($container->hasDefinition('assets.packages')) { - $container->getDefinition('templating.helper.assets')->replaceArgument(0, new Reference('assets.packages')); - } else { - $container->removeDefinition('templating.helper.assets'); - } } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml index 80148144cb65e..0b2861346d7ed 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml @@ -32,12 +32,6 @@ - - - - - - diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php deleted file mode 100644 index bf12a8bc47e5f..0000000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php +++ /dev/null @@ -1,7 +0,0 @@ -loadFromExtension('framework', array( - 'templating' => array( - 'engines' => array('php', 'twig'), - ), -)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index ef3272249c75c..9e1a8ebfd2fbd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -467,21 +467,6 @@ public function testSerializerEnabled() $this->assertTrue($container->has('serializer')); } - public function testAssetHelperWhenAssetsAreEnabled() - { - $container = $this->createContainerFromFile('full'); - $packages = $container->getDefinition('templating.helper.assets')->getArgument(0); - - $this->assertSame('assets.packages', (string) $packages); - } - - public function testAssetHelperWhenTemplatesAreEnabledAndAssetsAreDisabled() - { - $container = $this->createContainerFromFile('assets_disabled'); - - $this->assertFalse($container->hasDefinition('templating.helper.assets')); - } - protected function createContainer(array $data = array()) { return new ContainerBuilder(new ParameterBag(array_merge(array(