protected function determineDependencies(\ReflectionClass $class, int $skip): array
    {
        if (!$class->hasMethod('__construct')) {
            return [];
        }

        $constructor = $class->getMethod('__construct');
        $docComment = $constructor->getDocComment();
        $annotations = is_string($docComment) ? $this->extractParamAnnotations($docComment) : [];

        $identifiers = [];

        $params = $constructor->getParameters();
        $consideredParams = $skip === 0 ? $params : array_slice($params, $skip, null, true);

        foreach ($consideredParams as $index => $param) {
            $identifiers[$index] = (object)[
                'key' => $annotations[$index] ?? $this->getParamType($class, $param),
                'optional' => $param->allowsNull(),
            ];
        }

        return $identifiers;
    }
protected function determineDependencies(\ReflectionClass $class, int $skip): array
    {
        if (!$class->hasMethod('__construct')) {
            return [];
        }

        $constructor = $class->getMethod('__construct');
        $docComment = $constructor->getDocComment();
        $annotations = is_string($docComment) ? $this->extractParamAnnotations($docComment) : [];

        $identifiers = [];

        $params = $constructor->getParameters();
        $consideredParams = $skip === 0 ? $params : array_slice($params, $skip, null, true);

        foreach ($consideredParams as $index => $param) {
            $identifiers[$index] = (object)[
                'key' => $annotations[$index] ?? $this->getParamType($class, $param),
                'optional' => $param->allowsNull(),
            ];
        }

        return $identifiers;
    }
protected function determineDependencies ( \ ReflectionClass $ class , int $ skip ) : array { if ( ! $ class -> hasMethod ( '__construct' ) ) { return [ ] ; } $ constructor = $ class -> getMethod ( '__construct' ) ; $ docComment = $ constructor -> getDocComment ( ) ; $ annotations = is_string ( $ docComment ) ? $ this -> extractParamAnnotations ( $ docComment ) : [ ] ; $ identifiers = [ ] ; $ params = $ constructor -> getParameters ( ) ; $ consideredParams = $ skip === 0 ? $ params : array_slice ( $ params , $ skip , null , true ) ; foreach ( $ consideredParams as $ index => $ param ) { $ identifiers [ $ index ] = ( object ) [ 'key' => $ annotations [ $ index ] ?? $ this -> getParamType ( $ class , $ param ) , 'optional' => $ param -> allowsNull ( ) , ] ; } return $ identifiers ; }
Get all dependencies for a class constructor.

@param \ReflectionClass $class
@param int              $skip   Number of parameters to skip
@return object[]
Get all dependencies for a class constructor .