[[@doctodo method_description:handleDialog]].

@param [[@doctodo param_type:i]] $i [[@doctodo param_description:i]]

@return [[@doctodo return_type:handleDialog]] [[@doctodo return_description:handleDialog]]
3986
protected function handleDialog(&$i)
    {
        if (!isset($this->taskOptions['isForm'])) {
            $this->taskOptions['isForm'] = strstr($this->content, '<form') === false;
        }

        if (!isset($this->taskOptions['isConfirmation'])) {
            $this->taskOptions['isConfirmation'] = false;
        }

        if (!isset($this->taskOptions['isConfirmDeletion'])) {
            $this->taskOptions['isConfirmDeletion'] = false;
        }

        if (!isset($this->taskOptions['buttons'])) {
            $this->taskOptions['buttons'] = [];
            if ($this->taskOptions['isConfirmDeletion']) {
                $this->taskOptions['buttons'][$this->labels['confirm_delete']] = ['role' => 'submit', 'state' => 'danger', 'class' => 'delete-button-label'];
                $this->taskOptions['buttons'][$this->labels['confirm_cancel']] = ['role' => 'close'];
            } elseif ($this->taskOptions['isConfirmation']) {
                $this->taskOptions['buttons'][$this->labels['confirm_yes']] = ['role' => 'submit'];
                $this->taskOptions['buttons'][$this->labels['confirm_no']] = ['role' => 'close'];
            } elseif ($this->taskOptions['isForm']) {
                $this->taskOptions['buttons'][$this->labels['submit']] = ['role' => 'submit'];
                $this->taskOptions['buttons'][$this->labels['cancel']] = ['role' => 'close'];
            } else {
                $this->taskOptions['buttons'][$this->labels['close']] = ['role' => 'close'];
            }
        }

        return true;
    }
980772
private function listen_hook( $hook, $i, HookListenerInterface $listener ) {

		$is_filter = $listener instanceof FilterListenerInterface;

		if ( ! $is_filter && ! $listener instanceof ActionListenerInterface ) {
			return FALSE;
		}

		$callback = $this->hook_callback( $listener, $is_filter );

		$priority = $listener instanceof HookPriorityInterface ? (int) $listener->priority() : PHP_INT_MAX - 10;

		/**
		 * Filters the hook listener priority.
		 *
		 * @param int                   $priority
		 * @param string                $hook
		 * @param HookListenerInterface $listener
		 */
		$filtered = apply_filters( self::FILTER_PRIORITY, $priority, $hook, $listener );
		is_numeric( $filtered ) and $priority = (int) $filtered;

		return $is_filter
			? add_filter( $hook, $callback, $priority, PHP_INT_MAX )
			: add_action( $hook, $callback, $priority, PHP_INT_MAX );
	}
41935
static function parseUseTrait(array $tokens, &$i) {
    ++$i;
    $names = ParserUtil::parseIdentifierList($tokens, $i);
    if (FALSE === $names) {
      return FALSE;
    }
    $id = ParserUtil::nextSubstantialIncl($tokens, $i);
    if (';' === $id) {
      ++$i;
      return new AstUseTrait($names);
    }
    elseif ('{' === $id) {
      ParserUtil::skipCurly($tokens, $i);
      return new AstUseTrait($names);
    }
    else {
      return FALSE;
    }
  }
791741
public static function &GetAvailableTypes($iGroupId)
    {
        $shippingTypeDataAccess = self::getShippingTypeDataAccess();
        $shopService = self::getShopService();

        $oUser = self::getExtranetUserProvider()->getActiveUser();
        $oShippingAddress = $oUser->GetShippingAddress();
        $sActiveShippingCountryId = '';
        if ($oShippingAddress) {
            $sActiveShippingCountryId = $oShippingAddress->fieldDataCountryId;
        }
        if (true === empty($sActiveShippingCountryId)) {
            // use default country
            $oShop = $shopService->getActiveShop();
            if ($oShop) {
                $sActiveShippingCountryId = $oShop->fieldDataCountryId;
            }
        }
        $rows = $shippingTypeDataAccess->getAvailableShippingTypes($iGroupId, $sActiveShippingCountryId, $shopService->getActiveBasket());

        $idList = array();
        $oBasket = TShopBasket::GetInstance();
        $oBasket->ResetAllShippingMarkers(); // once we are done, we want to clear the marker again
        foreach ($rows as $row) {
            $item = TdbShopShippingType::GetNewInstance($row);
            if ($item->IsAvailable()) {
                $idList[] = $item->id;
            }
        }

        $query = 'SELECT * FROM `shop_shipping_type` WHERE `id` IN (:idList) ORDER BY `position`';
        $oList = new TdbShopShippingTypeList();
        $oList->Load($query, array('idList' => $idList), array('idList' => Connection::PARAM_STR_ARRAY));
        $oList->bAllowItemCache = true;

        $oList->RemoveInvalidItems();

        return $oList;
    }
847363
function get_position($i = null) {
    if ( isset($i) ) {
      return $this->_position[$i];
    }
    return $this->_position;
  }
1250046
public function offsetGet($i){
		$j = $i - 1; // becouse we counting lines form 0 not 1.
		if( !isIndex($this->lines,$j) ){
			(new Report('Blueprints/File/CantFindLine'))->stop();
		}
		// Add mark and sort all marks.
			$this->marks[] = $j;
			sort($this->marks);
		return $this->lines[$j];
	}
632324
public function getHandlerFor(string $type)
    {
        if (empty($this->handlers[$type])) {
            throw new \InvalidArgumentException('There is no handler for the "'.$type.'" criteria type.');
        } elseif (is_object($this->handlers[$type]) && $this->handlers[$type] instanceof CriteriaHandler) {
            return $this->handlers[$type];
        }

        return new $this->handlers[$type];
    }
470071
protected function flushText($i, $callback)
    {
        if ($this->type !== self::TYPE_TEXT || !strlen($this->buffer)) {
            return $this;
        }

        call_user_func($callback, [
            'type'  => $this->type,
            'start' => $i - strlen($this->buffer),
            'end'   => $i - 1,
            'level' => $this->level,
            'value' => $this->buffer
        ], $this->source);

        //flush
        $this->buffer = '';

        return $this;
    }
742821
public function getHandlerType(ContainerInterface $di = null) : string
    {
        $handler = new RouteHandler();
        return $handler->getHandlerType($this->handler, $di);
    }
29067
public function getTransactionHistory($i)
    {
        if (isset($this->history[$i])) {
            return $this->history[$i];
        } else {
            return false;
        }
    }
65884
public function get_step($i) {
        if ($i < 0 || $i >= count($this->steps)) {
            throw new coding_exception('Index out of bounds in question_attempt::get_step.');
        }
        return $this->steps[$i];
    }
677112
public function setCurrent($i)
    {
        $this->current = (int)$i;
        if (!isset($this->fields[$this->current])) {
            $this->fields[$this->current] = [];
        }
        return $this;
    }
69182
public function isColumnSearchable($i, $column_search = true)
    {
        if ($column_search) {
            return
                (
                    $this->request->input("columns.$i.searchable", 'true') === 'true'
                    ||
                    $this->request->input("columns.$i.searchable", 'true') === true
                )
                && $this->columnKeyword($i) != '';
        }

        return
            $this->request->input("columns.$i.searchable", 'true') === 'true'
            ||
            $this->request->input("columns.$i.searchable", 'true') === true;
    }
136418
public function getFields($i)
    {
        return (isset($this->fields[$i])) ? $this->fields[$i] : null;
    }
99561
public function get($eventType)
    {
        $handlers = array_merge_recursive(
            array_key_exists($eventType, $this->handlers) ? $this->handlers[$eventType] : [],
            array_key_exists('*', $this->handlers) ? $this->handlers['*'] : []
        );


        krsort($handlers, SORT_NUMERIC);

        $eventHandlers = [];
        foreach ($handlers as $priority => $handlersByPriority) {
            foreach ($handlersByPriority as $handler) {
                if ($this->resolver) {
                    $handler = call_user_func($this->resolver, $handler, $eventType);
                }

                $eventHandlers[] = $handler;
            }
        }

        return $eventHandlers;
    }
196287
public function getDetalhe($i)
    {
        return array_key_exists($i, $this->detalhe) ? $this->detalhe[$i] : null;
    }
292589
public function loop($callback, $i = 0)
    {
        //argument 1 must be callable
        Argument::i()->test(1, 'callable');
        
        $bound = $callback->bindTo($this, get_class($this));
        
        if (call_user_func($bound, $i) !== false) {
            $this->loop($callback, $i + 1);
        }
        
        return $this;
    }