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

        if (!isset($this->itemSetting[$name])) {
            return null;
        }

        $itemSetting = $this->itemSetting[$name];
        if (is_callable($itemSetting)) {
            $item = $itemSetting();
        } elseif (is_string($itemSetting) && class_exists($itemSetting)) {
            $item = new $itemSetting;
        } else {
            $item = $itemSetting;
        }

        $this->items[$name] = $item;
        return $item;
    }
public function get($name)
    {
        if (isset($this->items[$name])) {
            return $this->items[$name];
        }

        if (!isset($this->itemSetting[$name])) {
            return null;
        }

        $itemSetting = $this->itemSetting[$name];
        if (is_callable($itemSetting)) {
            $item = $itemSetting();
        } elseif (is_string($itemSetting) && class_exists($itemSetting)) {
            $item = new $itemSetting;
        } else {
            $item = $itemSetting;
        }

        $this->items[$name] = $item;
        return $item;
    }
public function get ( $ name ) { if ( isset ( $ this -> items [ $ name ] ) ) { return $ this -> items [ $ name ] ; } if ( ! isset ( $ this -> itemSetting [ $ name ] ) ) { return null ; } $ itemSetting = $ this -> itemSetting [ $ name ] ; if ( is_callable ( $ itemSetting ) ) { $ item = $ itemSetting ( ) ; } elseif ( is_string ( $ itemSetting ) && class_exists ( $ itemSetting ) ) { $ item = new $ itemSetting ; } else { $ item = $ itemSetting ; } $ this -> items [ $ name ] = $ item ; return $ item ; }
Get an item from container
@param string $name name for desired item
Get an item from container