/** * 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; } }
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))); } }
public function getAlias() { return $this->delegate->getAlias(); }
/** * Registers an extension. * * @param ExtensionInterface $extension An extension instance */ public static function registerExtension(ExtensionInterface $extension) { static::$extensions[$extension->getAlias()] = static::$extensions[$extension->getNamespace()] = $extension; }
/** * Replace an extension * @param ExtensionInterface $extension */ public static function replaceExtension(ExtensionInterface $extension) { self::$extensions[$extension->getAlias()] = $extension; }