php Symfony-Component-DependencyInjection-Extension-ExtensionInterface类(方法)实例源码

下面列出了php Symfony-Component-DependencyInjection-Extension-ExtensionInterface 类(方法)源码代码实例,从而了解它的用法。

作者:hyk    项目:Depo   
/**
  * Registers an extension.
  *
  * @param ExtensionInterface $extension An extension instance
  *
  * @api
  */
 public function registerExtension(ExtensionInterface $extension)
 {
     $this->extensions[$extension->getAlias()] = $extension;
     if (false !== $extension->getNamespace()) {
         $this->extensionsByNs[$extension->getNamespace()] = $extension;
     }
 }

作者:BusinessCookie    项目:CoffeeMachineProjec   
public function validateConfiguration(ExtensionInterface $extension, $configuration)
 {
     if (!$configuration) {
         throw new \LogicException(sprintf('The extension with alias "%s" does not have its getConfiguration() method setup', $extension->getAlias()));
     }
     if (!$configuration instanceof ConfigurationInterface) {
         throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', get_class($configuration)));
     }
 }

作者:roydonstharayi    项目:sugarbo   
/**
  * Registers an extension.
  *
  * @param ExtensionInterface $extension An extension instance
  */
 public static function registerExtension(ExtensionInterface $extension)
 {
     static::$extensions[$extension->getAlias()] = static::$extensions[$extension->getNamespace()] = $extension;
 }

作者:camspier    项目:shared-dependency-injectio   
/**
  * Replace an extension
  * @param ExtensionInterface $extension
  */
 public static function replaceExtension(ExtensionInterface $extension)
 {
     self::$extensions[$extension->getAlias()] = $extension;
 }

作者:intrir    项目:csv-bundl   
/**
  * @param $config
  *
  * @test
  * @dataProvider configProvider
  */
 public function testObjectGeneration($config)
 {
     $this->extension->load(array($config), $container = $this->getContainer());
     $importer1 = $container->get('intriro_csv.importer.foo');
     $importer2 = $container->get('intriro_csv.importer.bar');
     $exporter1 = $container->get('intriro_csv.exporter.foo');
     $exporter2 = $container->get('intriro_csv.exporter.bar');
     $this->assertInstanceOf('Goodby\\CSV\\Import\\Standard\\Lexer', $importer1);
     $this->assertInstanceOf('Goodby\\CSV\\Import\\Standard\\Lexer', $importer2);
     $this->assertInstanceOf('Goodby\\CSV\\Export\\Standard\\Exporter', $exporter1);
     $this->assertInstanceOf('Goodby\\CSV\\Export\\Standard\\Exporter', $exporter2);
 }

作者:planetenkille    项目:cor   
public function load(array $config, ContainerBuilder $container)
 {
     $this->delegate->load($config, new SandboxContainerBuilder($container, $this->serviceIds));
 }


问题


面经


文章

微信
公众号

扫码关注公众号