src/Vectorface/SnappyRouter/Di/ServiceProvider.php
private function getServiceFromServiceList($controllerClass)
    {
        // default provisioning mode uses a hardcoded list of services
        $serviceClass = $this->get($controllerClass);
        if (is_string($serviceClass) && !class_exists($serviceClass)) {
                require_once $serviceClass;
                $serviceClass = $controllerClass;
        } elseif (is_array($serviceClass)) {
            if (isset($serviceClass[Config::KEY_FILE])) {
                require_once $serviceClass[Config::KEY_FILE];
            }
            if (isset($serviceClass[Config::KEY_CLASS])) {
                $serviceClass = $serviceClass[Config::KEY_CLASS];
            }
        }
        return new $serviceClass();
    }
private function getServiceFromServiceList($controllerClass)
    {
        // default provisioning mode uses a hardcoded list of services
        $serviceClass = $this->get($controllerClass);
        if (is_string($serviceClass) && !class_exists($serviceClass)) {
                require_once $serviceClass;
                $serviceClass = $controllerClass;
        } elseif (is_array($serviceClass)) {
            if (isset($serviceClass[Config::KEY_FILE])) {
                require_once $serviceClass[Config::KEY_FILE];
            }
            if (isset($serviceClass[Config::KEY_CLASS])) {
                $serviceClass = $serviceClass[Config::KEY_CLASS];
            }
        }
        return new $serviceClass();
    }
private function getServiceFromServiceList ( $ controllerClass ) { // default provisioning mode uses a hardcoded list of services $ serviceClass = $ this -> get ( $ controllerClass ) ; if ( is_string ( $ serviceClass ) && ! class_exists ( $ serviceClass ) ) { require_once $ serviceClass ; $ serviceClass = $ controllerClass ; } elseif ( is_array ( $ serviceClass ) ) { if ( isset ( $ serviceClass [ Config :: KEY_FILE ] ) ) { require_once $ serviceClass [ Config :: KEY_FILE ] ; } if ( isset ( $ serviceClass [ Config :: KEY_CLASS ] ) ) { $ serviceClass = $ serviceClass [ Config :: KEY_CLASS ] ; } } return new $ serviceClass ( ) ; }
Returns an instance of the specified controller using the existing the
explicitly specified services list.
@param string $controllerClass The controller class we are resolving.
@return AbstractController Returns an instance of the controller.
Returns an instance of the specified controller using the existing the explicitly specified services list .