src/Box/Box.php
public function get($name)
    {
        if (!isset($this->_definitions[$name])) {
            throw new BoxException("Unexisting `{$name}` definition dependency.");
        }

        extract($this->_definitions[$name]);

        if ($type === 'singleton') {
            return $definition;
        }

        $params = func_get_args();
        array_shift($params);

        if ($type === 'service') {
            return $definition = $this->_service($name, $definition, $params);
        }
        return $definition = $this->_factory($definition, $params);
    }
public function get($name)
    {
        if (!isset($this->_definitions[$name])) {
            throw new BoxException("Unexisting `{$name}` definition dependency.");
        }

        extract($this->_definitions[$name]);

        if ($type === 'singleton') {
            return $definition;
        }

        $params = func_get_args();
        array_shift($params);

        if ($type === 'service') {
            return $definition = $this->_service($name, $definition, $params);
        }
        return $definition = $this->_factory($definition, $params);
    }
public function get ( $ name ) { if ( ! isset ( $ this -> _definitions [ $ name ] ) ) { throw new BoxException ( "Unexisting `{$name}` definition dependency." ) ; } extract ( $ this -> _definitions [ $ name ] ) ; if ( $ type === 'singleton' ) { return $ definition ; } $ params = func_get_args ( ) ; array_shift ( $ params ) ; if ( $ type === 'service' ) { return $ definition = $ this -> _service ( $ name , $ definition , $ params ) ; } return $ definition = $ this -> _factory ( $ definition , $ params ) ; }
Gets a shared variable or an new instance.

@param  string $name The name of the definition.
@param  mixed  ...   Parameter.
@return mixed        The shared variable or an new instance.
@throws BoxException if the definition doesn't exists.
Gets a shared variable or an new instance .