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