Horde_Injector_DependencyFinder::getMethodDependencies PHP Méthode

getMethodDependencies() public méthode

public getMethodDependencies ( Horde_Injector $injector, ReflectionMethod $method ) : array
$injector Horde_Injector
$method ReflectionMethod
Résultat array
    public function getMethodDependencies(Horde_Injector $injector, ReflectionMethod $method)
    {
        $dependencies = array();
        try {
            foreach ($method->getParameters() as $parameter) {
                $dependencies[] = $this->getParameterDependency($injector, $parameter);
            }
        } catch (Horde_Injector_Exception $e) {
            throw new Horde_Injector_Exception("{$method} has unfulfilled dependencies ({$parameter})", 0, $e);
        }
        return $dependencies;
    }

Usage Example

Exemple #1
0
 /**
  */
 protected function _getInstance(Horde_Injector $injector, ReflectionClass $class)
 {
     return $class->getConstructor() ? $class->newInstanceArgs($this->_dependencyFinder->getMethodDependencies($injector, $class->getConstructor())) : $class->newInstance();
 }
All Usage Examples Of Horde_Injector_DependencyFinder::getMethodDependencies