public function make($class, array $dependencies = [])
    {
        if ($class instanceof Raw) {
            return $class->getValue();
        }

        if ( ! is_string($class)) {
            return $class;
        }

        if (array_key_exists($class, $this->bindings)) {
            return $this->bindings[$class]();
        }

        if ( ! class_exists($class)) {
            throw new Exceptions\ClassDoesNotExistException($class);
        }

        $reflector = new ReflectionClass($class);

        $isInstantiable =
            is_null($reflector->getConstructor()) ?: $reflector->getConstructor()->isPublic();

        if ($reflector->isAbstract() or ! $isInstantiable) {
            throw new Exceptions\ClassIsNotInstantiableException($class);
        }

        if (count($dependencies) > 0) {
            return $reflector->newInstanceArgs(array_map([$this, "make"], $dependencies));
        }

        if ( ! $resolved = $this->attemptToResolve($reflector)) {
            throw new Exceptions\ResolutionException($class);
        }

        return $resolved;
    }
public function make($class, array $dependencies = [])
    {
        if ($class instanceof Raw) {
            return $class->getValue();
        }

        if ( ! is_string($class)) {
            return $class;
        }

        if (array_key_exists($class, $this->bindings)) {
            return $this->bindings[$class]();
        }

        if ( ! class_exists($class)) {
            throw new Exceptions\ClassDoesNotExistException($class);
        }

        $reflector = new ReflectionClass($class);

        $isInstantiable =
            is_null($reflector->getConstructor()) ?: $reflector->getConstructor()->isPublic();

        if ($reflector->isAbstract() or ! $isInstantiable) {
            throw new Exceptions\ClassIsNotInstantiableException($class);
        }

        if (count($dependencies) > 0) {
            return $reflector->newInstanceArgs(array_map([$this, "make"], $dependencies));
        }

        if ( ! $resolved = $this->attemptToResolve($reflector)) {
            throw new Exceptions\ResolutionException($class);
        }

        return $resolved;
    }
public function make ( $ class , array $ dependencies = [ ] ) { if ( $ class instanceof Raw ) { return $ class -> getValue ( ) ; } if ( ! is_string ( $ class ) ) { return $ class ; } if ( array_key_exists ( $ class , $ this -> bindings ) ) { return $ this -> bindings [ $ class ] ( ) ; } if ( ! class_exists ( $ class ) ) { throw new Exceptions \ ClassDoesNotExistException ( $ class ) ; } $ reflector = new ReflectionClass ( $ class ) ; $ isInstantiable = is_null ( $ reflector -> getConstructor ( ) ) ? : $ reflector -> getConstructor ( ) -> isPublic ( ) ; if ( $ reflector -> isAbstract ( ) or ! $ isInstantiable ) { throw new Exceptions \ ClassIsNotInstantiableException ( $ class ) ; } if ( count ( $ dependencies ) > 0 ) { return $ reflector -> newInstanceArgs ( array_map ( [ $ this , "make" ] , $ dependencies ) ) ; } if ( ! $ resolved = $ this -> attemptToResolve ( $ reflector ) ) { throw new Exceptions \ ResolutionException ( $ class ) ; } return $ resolved ; }
Resolves the given class' dependencies.

@param string|mixed $class
@param array $dependencies
@throws Exceptions\ClassDoesNotExistException
@throws Exceptions\ClassIsNotInstantiableException
@throws Exceptions\ResolutionException
@return mixed
Resolves the given class dependencies .