src/Container.php
public function resolve($key) {
        if (!array_key_exists($key, $this->bindings)) {
            throw new InvalidArgumentException("{$key} is not bound.");
        }

        $binding = $this->bindings[$key];
        $value = $binding['value'];

        // singleton
        if ($value instanceof Closure) {
            return $value($this);
        }

        // anonymous object
        if (is_null($value) && class_exists('\\' . $key)) {
            return $this->make($key);
        }

        // labeled object
        if (is_string($value) && class_exists('\\' . $value)) {
            return $this->make($value);
        }

        return $value;
    }
public function resolve($key) {
        if (!array_key_exists($key, $this->bindings)) {
            throw new InvalidArgumentException("{$key} is not bound.");
        }

        $binding = $this->bindings[$key];
        $value = $binding['value'];

        // singleton
        if ($value instanceof Closure) {
            return $value($this);
        }

        // anonymous object
        if (is_null($value) && class_exists('\\' . $key)) {
            return $this->make($key);
        }

        // labeled object
        if (is_string($value) && class_exists('\\' . $value)) {
            return $this->make($value);
        }

        return $value;
    }
public function resolve ( $ key ) { if ( ! array_key_exists ( $ key , $ this -> bindings ) ) { throw new InvalidArgumentException ( "{$key} is not bound." ) ; } $ binding = $ this -> bindings [ $ key ] ; $ value = $ binding [ 'value' ] ; // singleton if ( $ value instanceof Closure ) { return $ value ( $ this ) ; } // anonymous object if ( is_null ( $ value ) && class_exists ( '\\' . $ key ) ) { return $ this -> make ( $ key ) ; } // labeled object if ( is_string ( $ value ) && class_exists ( '\\' . $ value ) ) { return $ this -> make ( $ value ) ; } return $ value ; }
Resolve the value from the given offset

@param string $key
@return mixed
Resolve the value from the given offset