Bläddra i källkod

updated all core extensions to use the new shortcut method

Fabien Potencier 14 år sedan
förälder
incheckning
c3a060e368

+ 1 - 3
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

@@ -19,7 +19,6 @@ use Symfony\Component\DependencyInjection\DefinitionDecorator;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Bundle\DoctrineAbstractBundle\DependencyInjection\AbstractDoctrineExtension;
 use Symfony\Bundle\DoctrineAbstractBundle\DependencyInjection\AbstractDoctrineExtension;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 
 
 /**
 /**
  * DoctrineExtension is an extension for the Doctrine DBAL and ORM library.
  * DoctrineExtension is an extension for the Doctrine DBAL and ORM library.
@@ -32,9 +31,8 @@ class DoctrineExtension extends AbstractDoctrineExtension
 {
 {
     public function load(array $configs, ContainerBuilder $container)
     public function load(array $configs, ContainerBuilder $container)
     {
     {
-        $processor = new Processor();
         $configuration = new Configuration($container->getParameter('kernel.debug'));
         $configuration = new Configuration($container->getParameter('kernel.debug'));
-        $config = $processor->processConfiguration($configuration, $configs);
+        $config = $this->processConfiguration($configuration, $configs);
 
 
         if (!empty($config['dbal'])) {
         if (!empty($config['dbal'])) {
             $this->dbalLoad($config['dbal'], $container);
             $this->dbalLoad($config['dbal'], $container);

+ 1 - 3
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

@@ -22,7 +22,6 @@ use Symfony\Component\Config\Resource\FileResource;
 use Symfony\Component\Finder\Finder;
 use Symfony\Component\Finder\Finder;
 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 
 
 /**
 /**
  * FrameworkExtension.
  * FrameworkExtension.
@@ -56,9 +55,8 @@ class FrameworkExtension extends Extension
             $container->setAlias('debug.event_dispatcher', 'event_dispatcher');
             $container->setAlias('debug.event_dispatcher', 'event_dispatcher');
         }
         }
 
 
-        $processor = new Processor();
         $configuration = new Configuration($container->getParameter('kernel.debug'));
         $configuration = new Configuration($container->getParameter('kernel.debug'));
-        $config = $processor->processConfiguration($configuration, $configs);
+        $config = $this->processConfiguration($configuration, $configs);
 
 
         if (isset($config['charset'])) {
         if (isset($config['charset'])) {
             $container->setParameter('kernel.charset', $config['charset']);
             $container->setParameter('kernel.charset', $config['charset']);

+ 1 - 3
src/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php

@@ -15,7 +15,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 use Symfony\Component\DependencyInjection\Definition;
 use Symfony\Component\DependencyInjection\Definition;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Parameter;
 use Symfony\Component\DependencyInjection\Parameter;
@@ -39,8 +38,7 @@ class MonologExtension extends Extension
     public function load(array $configs, ContainerBuilder $container)
     public function load(array $configs, ContainerBuilder $container)
     {
     {
         $configuration = new Configuration();
         $configuration = new Configuration();
-        $processor = new Processor();
-        $config = $processor->processConfiguration($configuration, $configs);
+        $config = $this->processConfiguration($configuration, $configs);
 
 
         if (isset($config['handlers'])) {
         if (isset($config['handlers'])) {
             $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
             $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

+ 2 - 5
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

@@ -23,7 +23,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Parameter;
 use Symfony\Component\DependencyInjection\Parameter;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 
 
 /**
 /**
  * SecurityExtension.
  * SecurityExtension.
@@ -44,16 +43,14 @@ class SecurityExtension extends Extension
             return;
             return;
         }
         }
 
 
-        $processor = new Processor();
-
         // first assemble the factories
         // first assemble the factories
         $factoriesConfig = new FactoryConfiguration();
         $factoriesConfig = new FactoryConfiguration();
-        $config = $processor->processConfiguration($factoriesConfig, $configs);
+        $config = $this->processConfiguration($factoriesConfig, $configs);
         $factories = $this->createListenerFactories($container, $config);
         $factories = $this->createListenerFactories($container, $config);
 
 
         // normalize and merge the actual configuration
         // normalize and merge the actual configuration
         $mainConfig = new MainConfiguration($factories);
         $mainConfig = new MainConfiguration($factories);
-        $config = $processor->processConfiguration($mainConfig, $configs);
+        $config = $this->processConfiguration($mainConfig, $configs);
 
 
         // load services
         // load services
         $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

+ 1 - 3
src/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php

@@ -16,7 +16,6 @@ use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 
 
 /**
 /**
  * SwiftmailerExtension is an extension for the SwiftMailer library.
  * SwiftmailerExtension is an extension for the SwiftMailer library.
@@ -45,9 +44,8 @@ class SwiftmailerExtension extends Extension
         $loader->load('swiftmailer.xml');
         $loader->load('swiftmailer.xml');
         $container->setAlias('mailer', 'swiftmailer.mailer');
         $container->setAlias('mailer', 'swiftmailer.mailer');
 
 
-        $processor = new Processor();
         $configuration = new Configuration($container->getParameter('kernel.debug'));
         $configuration = new Configuration($container->getParameter('kernel.debug'));
-        $config = $processor->processConfiguration($configuration, $configs);
+        $config = $this->processConfiguration($configuration, $configs);
 
 
         if (null === $config['transport']) {
         if (null === $config['transport']) {
             $transport = 'null';
             $transport = 'null';

+ 1 - 3
src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

@@ -12,7 +12,6 @@
 namespace Symfony\Bundle\TwigBundle\DependencyInjection;
 namespace Symfony\Bundle\TwigBundle\DependencyInjection;
 
 
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@@ -37,9 +36,8 @@ class TwigExtension extends Extension
         $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loader->load('twig.xml');
         $loader->load('twig.xml');
 
 
-        $processor = new Processor();
         $configuration = new Configuration();
         $configuration = new Configuration();
-        $config = $processor->processConfiguration($configuration, $configs);
+        $config = $this->processConfiguration($configuration, $configs);
 
 
         $container->setParameter('twig.form.resources', $config['form']['resources']);
         $container->setParameter('twig.form.resources', $config['form']['resources']);
         $container->getDefinition('twig.loader')->addMethodCall('addPath', array(__DIR__.'/../../../Bridge/Twig/Resources/views/Form'));
         $container->getDefinition('twig.loader')->addMethodCall('addPath', array(__DIR__.'/../../../Bridge/Twig/Resources/views/Form'));

+ 1 - 3
src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php

@@ -15,7 +15,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\FileLocator;
-use Symfony\Component\Config\Definition\Processor;
 use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener;
 use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener;
 
 
 /**
 /**
@@ -40,9 +39,8 @@ class WebProfilerExtension extends Extension
      */
      */
     public function load(array $configs, ContainerBuilder $container)
     public function load(array $configs, ContainerBuilder $container)
     {
     {
-        $processor = new Processor();
         $configuration = new Configuration();
         $configuration = new Configuration();
-        $config = $processor->processConfiguration($configuration, $configs);
+        $config = $this->processConfiguration($configuration, $configs);
 
 
         $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loader->load('toolbar.xml');
         $loader->load('toolbar.xml');