src/Container.php
private function resolve($name)
    {   
        // set as resolved
        $this->resolved[$name] = true;
        
        // resolve the service
        if (is_string($this->instances[$name]) && class_exists($this->instances[$name])) 
        {
            
            $object = $this->instances[$name];

            return new $object();

        }
        elseif(is_callable($this->instances[$name]))
        {

            $callable = $this->instances[$name];

            return $callable();

        }    

        return $this->instances[$name];
    }
private function resolve($name)
    {   
        // set as resolved
        $this->resolved[$name] = true;
        
        // resolve the service
        if (is_string($this->instances[$name]) && class_exists($this->instances[$name])) 
        {
            
            $object = $this->instances[$name];

            return new $object();

        }
        elseif(is_callable($this->instances[$name]))
        {

            $callable = $this->instances[$name];

            return $callable();

        }    

        return $this->instances[$name];
    }
private function resolve ( $ name ) { // set as resolved $ this -> resolved [ $ name ] = true ; // resolve the service if ( is_string ( $ this -> instances [ $ name ] ) && class_exists ( $ this -> instances [ $ name ] ) ) { $ object = $ this -> instances [ $ name ] ; return new $ object ( ) ; } elseif ( is_callable ( $ this -> instances [ $ name ] ) ) { $ callable = $ this -> instances [ $ name ] ; return $ callable ( ) ; } return $ this -> instances [ $ name ] ; }
Try to resolve the service
Try to resolve the service