src/Core/Extensible.php
public function getExtensionInstance($extension)
    {
        $instances = $this->getExtensionInstances();
        if (array_key_exists($extension, $instances)) {
            return $instances[$extension];
        }
        // in case Injector has been used to replace an extension
        foreach ($instances as $instance) {
            if (is_a($instance, $extension)) {
                return $instance;
            }
        }
        return null;
    }
public function getExtensionInstance($extension)
    {
        $instances = $this->getExtensionInstances();
        if (array_key_exists($extension, $instances)) {
            return $instances[$extension];
        }
        // in case Injector has been used to replace an extension
        foreach ($instances as $instance) {
            if (is_a($instance, $extension)) {
                return $instance;
            }
        }
        return null;
    }
public function getExtensionInstance ( $ extension ) { $ instances = $ this -> getExtensionInstances ( ) ; if ( array_key_exists ( $ extension , $ instances ) ) { return $ instances [ $ extension ] ; } // in case Injector has been used to replace an extension foreach ( $ instances as $ instance ) { if ( is_a ( $ instance , $ extension ) ) { return $ instance ; } } return null ; }
Get an extension instance attached to this object by name.

@param string $extension
@return Extension|null
Get an extension instance attached to this object by name .