public function getShared($name)
    {
        if (isset($this->_instances[$name])) {
            return $this->_instances[$name];
        }

        if (isset($this->_definitions[$name])) {
            return $this->_instances[$name] = $this->getInstance($this->_definitions[$name], null, $name);
        } elseif (strpos($name, '\\') !== false) {
            return $this->_instances[$name] = $this->getInstance($name, null, $name);
        } else {
            $className = $this->_getPatterned($name);
            if ($className === null) {
                throw new InvalidValueException(['`:component` component is not exists', 'component' => $name]);
            }
            return $this->_instances[$name] = $this->getInstance($className, null, $name);
        }
    }
public function getShared($name)
    {
        if (isset($this->_instances[$name])) {
            return $this->_instances[$name];
        }

        if (isset($this->_definitions[$name])) {
            return $this->_instances[$name] = $this->getInstance($this->_definitions[$name], null, $name);
        } elseif (strpos($name, '\\') !== false) {
            return $this->_instances[$name] = $this->getInstance($name, null, $name);
        } else {
            $className = $this->_getPatterned($name);
            if ($className === null) {
                throw new InvalidValueException(['`:component` component is not exists', 'component' => $name]);
            }
            return $this->_instances[$name] = $this->getInstance($className, null, $name);
        }
    }
public function getShared ( $ name ) { if ( isset ( $ this -> _instances [ $ name ] ) ) { return $ this -> _instances [ $ name ] ; } if ( isset ( $ this -> _definitions [ $ name ] ) ) { return $ this -> _instances [ $ name ] = $ this -> getInstance ( $ this -> _definitions [ $ name ] , null , $ name ) ; } elseif ( strpos ( $ name , '\\' ) !== false ) { return $ this -> _instances [ $ name ] = $ this -> getInstance ( $ name , null , $ name ) ; } else { $ className = $ this -> _getPatterned ( $ name ) ; if ( $ className === null ) { throw new InvalidValueException ( [ '`:component` component is not exists' , 'component' => $ name ] ) ; } return $ this -> _instances [ $ name ] = $ this -> getInstance ( $ className , null , $ name ) ; } }
Resolves a component, the resolved component is stored in the DI, subsequent requests for this component will return the same instance

@param string $name

@return mixed
Resolves a component the resolved component is stored in the DI subsequent requests for this component will return the same instance