public function instantiate(string $class, ...$args)
    {
        $refl = $this->reflection->reflectClass($class);

        $dependencyIds = $this->determineDependencies($refl, count($args));
        $dependencies = $args + $this->getDependencies($dependencyIds);

        return $refl->newInstanceArgs($dependencies);
    }
public function instantiate(string $class, ...$args)
    {
        $refl = $this->reflection->reflectClass($class);

        $dependencyIds = $this->determineDependencies($refl, count($args));
        $dependencies = $args + $this->getDependencies($dependencyIds);

        return $refl->newInstanceArgs($dependencies);
    }
public function instantiate ( string $ class , ... $ args ) { $ refl = $ this -> reflection -> reflectClass ( $ class ) ; $ dependencyIds = $ this -> determineDependencies ( $ refl , count ( $ args ) ) ; $ dependencies = $ args + $ this -> getDependencies ( $ dependencyIds ) ; return $ refl -> newInstanceArgs ( $ dependencies ) ; }
Instantiate a new object, automatically injecting dependencies

@param string $class
@param mixed  ...$args  Additional arguments are passed to the constructor directly.
@return object
@throws AutowireException
@throws \ReflectionException
Instantiate a new object automatically injecting dependencies