protected function createInstance(string $name, int $useStoredDependencies)
    {
        $name = $this->getDefinitiveName($name);

        if (interface_exists($name)) {
            throw new ContainerException(sprintf(
                "Cannot create instance for interface `%s`.",
                $name
            ));
        }

        try {
            $dependencies = $this->getDependenciesFor($name, $useStoredDependencies);
        } catch (Throwable $e) {
            throw new ContainerException($e->getMessage());
        }

        return new $name(...$dependencies);
    }
protected function createInstance(string $name, int $useStoredDependencies)
    {
        $name = $this->getDefinitiveName($name);

        if (interface_exists($name)) {
            throw new ContainerException(sprintf(
                "Cannot create instance for interface `%s`.",
                $name
            ));
        }

        try {
            $dependencies = $this->getDependenciesFor($name, $useStoredDependencies);
        } catch (Throwable $e) {
            throw new ContainerException($e->getMessage());
        }

        return new $name(...$dependencies);
    }
protected function createInstance ( string $ name , int $ useStoredDependencies ) { $ name = $ this -> getDefinitiveName ( $ name ) ; if ( interface_exists ( $ name ) ) { throw new ContainerException ( sprintf ( "Cannot create instance for interface `%s`." , $ name ) ) ; } try { $ dependencies = $ this -> getDependenciesFor ( $ name , $ useStoredDependencies ) ; } catch ( Throwable $ e ) { throw new ContainerException ( $ e -> getMessage ( ) ) ; } return new $ name ( ... $ dependencies ) ; }
Create an instance with either new or existing dependencies.

@throws ContainerException
Create an instance with either new or existing dependencies .