protected static function createInstance($className, $parentClassName = '', $createAll = false)
    {
        $className = self::cleanName($className);

        try {
            $dependencies = self::getDependenciesFor($className, $createAll);
        } catch (\Parable\DI\Exception $e) {
            $message = $e->getMessage();
            if ($parentClassName) {
                $message .= ", required by '{$parentClassName}'";
            }
            throw new \Parable\DI\Exception($message);
        }
        return new $className(...$dependencies);
    }
protected static function createInstance($className, $parentClassName = '', $createAll = false)
    {
        $className = self::cleanName($className);

        try {
            $dependencies = self::getDependenciesFor($className, $createAll);
        } catch (\Parable\DI\Exception $e) {
            $message = $e->getMessage();
            if ($parentClassName) {
                $message .= ", required by '{$parentClassName}'";
            }
            throw new \Parable\DI\Exception($message);
        }
        return new $className(...$dependencies);
    }
protected static function createInstance ( $ className , $ parentClassName = '' , $ createAll = false ) { $ className = self :: cleanName ( $ className ) ; try { $ dependencies = self :: getDependenciesFor ( $ className , $ createAll ) ; } catch ( \ Parable \ DI \ Exception $ e ) { $ message = $ e -> getMessage ( ) ; if ( $ parentClassName ) { $ message .= ", required by '{$parentClassName}'" ; } throw new \ Parable \ DI \ Exception ( $ message ) ; } return new $ className ( ... $ dependencies ) ; }
Instantiate a class and fulfill its dependency requirements.

@param string $className
@param string $parentClassName
@param bool   $createAll

@return mixed
@throws \Parable\DI\Exception
Instantiate a class and fulfill its dependency requirements .