protected function instance($class)
    {
        $reflection = new \ReflectionClass($class);

        $arguments = array();

        $constructor = $reflection->getConstructor();

        if ($this->container->has($class))
        {
            return $this->container->get($class);
        }

        if ($constructor !== null)
        {
            $arguments = $this->arguments($constructor);
        }

        return $reflection->newInstanceArgs($arguments);
    }
protected function instance($class)
    {
        $reflection = new \ReflectionClass($class);

        $arguments = array();

        $constructor = $reflection->getConstructor();

        if ($this->container->has($class))
        {
            return $this->container->get($class);
        }

        if ($constructor !== null)
        {
            $arguments = $this->arguments($constructor);
        }

        return $reflection->newInstanceArgs($arguments);
    }
protected function instance ( $ class ) { $ reflection = new \ ReflectionClass ( $ class ) ; $ arguments = array ( ) ; $ constructor = $ reflection -> getConstructor ( ) ; if ( $ this -> container -> has ( $ class ) ) { return $ this -> container -> get ( $ class ) ; } if ( $ constructor !== null ) { $ arguments = $ this -> arguments ( $ constructor ) ; } return $ reflection -> newInstanceArgs ( $ arguments ) ; }
Returns the instance of the identifier from the container.

@param  string $class
@return mixed
Returns the instance of the identifier from the container .