Swift_DependencyContainer::lookup PHP Method

lookup() public method

Lookup the item with the given $itemName.
See also: register()
public lookup ( string $itemName ) : mixed
$itemName string
return mixed
    public function lookup($itemName)
    {
        if (!$this->has($itemName)) {
            throw new Swift_DependencyException('Cannot lookup dependency "' . $itemName . '" since it is not registered.');
        }
        switch ($this->_store[$itemName]['lookupType']) {
            case self::TYPE_ALIAS:
                return $this->_createAlias($itemName);
            case self::TYPE_VALUE:
                return $this->_getValue($itemName);
            case self::TYPE_INSTANCE:
                return $this->_createNewInstance($itemName);
            case self::TYPE_SHARED:
                return $this->_createSharedInstance($itemName);
        }
    }