Extension/ExtensionRegistry.php
public function addExtension(ExtensionInterface $extension)
    {
        if (array_key_exists($name = $extension->getName(), $this->extensions)) {
            throw new \RuntimeException(sprintf('UserExtension "%s" is already registered.', $name));
        }

        $this->extensions[$name] = $extension;
    }
public function addExtension(ExtensionInterface $extension)
    {
        if (array_key_exists($name = $extension->getName(), $this->extensions)) {
            throw new \RuntimeException(sprintf('UserExtension "%s" is already registered.', $name));
        }

        $this->extensions[$name] = $extension;
    }
public function addExtension ( ExtensionInterface $ extension ) { if ( array_key_exists ( $ name = $ extension -> getName ( ) , $ this -> extensions ) ) { throw new \ RuntimeException ( sprintf ( 'UserExtension "%s" is already registered.' , $ name ) ) ; } $ this -> extensions [ $ name ] = $ extension ; }
Adds the extension.

@param ExtensionInterface $extension
Adds the extension .