private function getWiredParameters(\ReflectionClass $reflection, array $overrides): array
    {
        $constructor = $reflection->getConstructor();

        if (!$constructor instanceof \ReflectionMethod) {
            return [];
        }

        $parameters = [];

        foreach ($constructor->getParameters() as $parameter) {
            $name = '$' . $parameter->getName();

            if (isset($overrides[$name])) {
                $parameters[] = $overrides[$name];
                continue;
            }

            $type = $parameter->getType();

            if (!$type instanceof \ReflectionType || $type->isBuiltin()) {
                throw new \InvalidArgumentException(
                    sprintf("Missing autowired parameter '%s' for '%s'", $name, $reflection->getName())
                );
            }

            $parameters[] = $type->getName();
        }

        return $parameters;
    }
private function getWiredParameters(\ReflectionClass $reflection, array $overrides): array
    {
        $constructor = $reflection->getConstructor();

        if (!$constructor instanceof \ReflectionMethod) {
            return [];
        }

        $parameters = [];

        foreach ($constructor->getParameters() as $parameter) {
            $name = '$' . $parameter->getName();

            if (isset($overrides[$name])) {
                $parameters[] = $overrides[$name];
                continue;
            }

            $type = $parameter->getType();

            if (!$type instanceof \ReflectionType || $type->isBuiltin()) {
                throw new \InvalidArgumentException(
                    sprintf("Missing autowired parameter '%s' for '%s'", $name, $reflection->getName())
                );
            }

            $parameters[] = $type->getName();
        }

        return $parameters;
    }
private function getWiredParameters ( \ ReflectionClass $ reflection , array $ overrides ) : array { $ constructor = $ reflection -> getConstructor ( ) ; if ( ! $ constructor instanceof \ ReflectionMethod ) { return [ ] ; } $ parameters = [ ] ; foreach ( $ constructor -> getParameters ( ) as $ parameter ) { $ name = '$' . $ parameter -> getName ( ) ; if ( isset ( $ overrides [ $ name ] ) ) { $ parameters [ ] = $ overrides [ $ name ] ; continue ; } $ type = $ parameter -> getType ( ) ; if ( ! $ type instanceof \ ReflectionType || $ type -> isBuiltin ( ) ) { throw new \ InvalidArgumentException ( sprintf ( "Missing autowired parameter '%s' for '%s'" , $ name , $ reflection -> getName ( ) ) ) ; } $ parameters [ ] = $ type -> getName ( ) ; } return $ parameters ; }
Loads the parameter identifiers based on the constructor arguments and provided overrides.
@param \ReflectionClass $reflection The class reflection to inspect
@param string[] $overrides Override identifiers for constructor parameters
@return string[] Identifiers for constructor parameters
Loads the parameter identifiers based on the constructor arguments and provided overrides .