public function get($key, array $parameters = [])
    {
        // If service is a factory, we should always
        // return new instance of the service.
        if (isset($this->factories[$key])) {
            return $this->resolve($this->factories[$key], $parameters);
        }

        // Otherwise, look for service
        // in services collection.
        if (isset($this->services[$key])) {
            // Resolve service jf we don't have
            // a deposit for this service.
            if ( ! isset($this->deposit[$key])) {
                $this->deposit[$key] = $this->resolve($this->services[$key], $parameters);
            }

            return $this->deposit[$key];
        }

        throw new BindingResolutionException("Unresolvable resolution. The [{$key}] binding is not registered.");
    }
public function get($key, array $parameters = [])
    {
        // If service is a factory, we should always
        // return new instance of the service.
        if (isset($this->factories[$key])) {
            return $this->resolve($this->factories[$key], $parameters);
        }

        // Otherwise, look for service
        // in services collection.
        if (isset($this->services[$key])) {
            // Resolve service jf we don't have
            // a deposit for this service.
            if ( ! isset($this->deposit[$key])) {
                $this->deposit[$key] = $this->resolve($this->services[$key], $parameters);
            }

            return $this->deposit[$key];
        }

        throw new BindingResolutionException("Unresolvable resolution. The [{$key}] binding is not registered.");
    }
public function get ( $ key , array $ parameters = [ ] ) { // If service is a factory, we should always // return new instance of the service. if ( isset ( $ this -> factories [ $ key ] ) ) { return $ this -> resolve ( $ this -> factories [ $ key ] , $ parameters ) ; } // Otherwise, look for service // in services collection. if ( isset ( $ this -> services [ $ key ] ) ) { // Resolve service jf we don't have // a deposit for this service. if ( ! isset ( $ this -> deposit [ $ key ] ) ) { $ this -> deposit [ $ key ] = $ this -> resolve ( $ this -> services [ $ key ] , $ parameters ) ; } return $ this -> deposit [ $ key ] ; } throw new BindingResolutionException ( "Unresolvable resolution. The [{$key}] binding is not registered." ) ; }
Resolve service form container.

@param  string $key
@param  array  $parameters

@return mixed
Resolve service form container .