protected function initReverseParamsGetGreedyInfo (& $reverseSectionsInfo, & $constraints, & $paramName, & $sectionIndex, & $greedyCaught) {
		// complete greedy flag by star character inside param name
		$greedyFlag = mb_strpos($paramName, '*') !== FALSE;
		$sectionIsLast = NULL;
		// check greedy param specifics
		if ($greedyFlag) {
			if ($greedyFlag && $greedyCaught) {
				$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
				throw new \InvalidArgumentException(
					"[".$selfClass."] Route pattern definition can have only one greedy `<param_name*>` "
					." with star (to include everything - all characters and slashes . `.*`) ($this)."
				);
			}
			$reverseSectionsCount = count($reverseSectionsInfo);
			$sectionIndexPlusOne = $sectionIndex + 1;
			if (// next section is optional
				$sectionIndexPlusOne < $reverseSectionsCount &&
				!($reverseSectionsInfo[$sectionIndexPlusOne]->fixed)
			) {
				// check if param is really greedy or not
				$constraintDefined = isset($constraints[$paramName]);
				$constraint = $constraintDefined ? $constraints[$paramName] : NULL ;
				$greedyReal = !$constraintDefined || ($constraintDefined && (
					mb_strpos($constraint, '.*') !== FALSE || mb_strpos($constraint, '.+') !== FALSE
				));
				if ($greedyReal) {
					$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
					throw new \InvalidArgumentException(
						"[".$selfClass."] Route pattern definition can not have greedy `<param_name*>` with star "
						."(to include everything - all characters and slashes . `.*`) immediately before optional "
						."section ($this)."
					);
				}
			}
			$greedyCaught = TRUE;
			$paramName = str_replace('*', '', $paramName);
			$sectionIsLast = $sectionIndexPlusOne === $reverseSectionsCount;
		}
		return [$greedyFlag, $sectionIsLast];
	}
protected function initReverseParamsGetGreedyInfo (& $reverseSectionsInfo, & $constraints, & $paramName, & $sectionIndex, & $greedyCaught) {
		// complete greedy flag by star character inside param name
		$greedyFlag = mb_strpos($paramName, '*') !== FALSE;
		$sectionIsLast = NULL;
		// check greedy param specifics
		if ($greedyFlag) {
			if ($greedyFlag && $greedyCaught) {
				$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
				throw new \InvalidArgumentException(
					"[".$selfClass."] Route pattern definition can have only one greedy `<param_name*>` "
					." with star (to include everything - all characters and slashes . `.*`) ($this)."
				);
			}
			$reverseSectionsCount = count($reverseSectionsInfo);
			$sectionIndexPlusOne = $sectionIndex + 1;
			if (// next section is optional
				$sectionIndexPlusOne < $reverseSectionsCount &&
				!($reverseSectionsInfo[$sectionIndexPlusOne]->fixed)
			) {
				// check if param is really greedy or not
				$constraintDefined = isset($constraints[$paramName]);
				$constraint = $constraintDefined ? $constraints[$paramName] : NULL ;
				$greedyReal = !$constraintDefined || ($constraintDefined && (
					mb_strpos($constraint, '.*') !== FALSE || mb_strpos($constraint, '.+') !== FALSE
				));
				if ($greedyReal) {
					$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
					throw new \InvalidArgumentException(
						"[".$selfClass."] Route pattern definition can not have greedy `<param_name*>` with star "
						."(to include everything - all characters and slashes . `.*`) immediately before optional "
						."section ($this)."
					);
				}
			}
			$greedyCaught = TRUE;
			$paramName = str_replace('*', '', $paramName);
			$sectionIsLast = $sectionIndexPlusOne === $reverseSectionsCount;
		}
		return [$greedyFlag, $sectionIsLast];
	}
protected function initReverseParamsGetGreedyInfo ( & $ reverseSectionsInfo , & $ constraints , & $ paramName , & $ sectionIndex , & $ greedyCaught ) { // complete greedy flag by star character inside param name $ greedyFlag = mb_strpos ( $ paramName , '*' ) !== FALSE ; $ sectionIsLast = NULL ; // check greedy param specifics if ( $ greedyFlag ) { if ( $ greedyFlag && $ greedyCaught ) { $ selfClass = version_compare ( PHP_VERSION , '5.5' , '>' ) ? self :: class : __CLASS__ ; throw new \ InvalidArgumentException ( "[" . $ selfClass . "] Route pattern definition can have only one greedy `<param_name*>` " . " with star (to include everything - all characters and slashes . `.*`) ($this)." ) ; } $ reverseSectionsCount = count ( $ reverseSectionsInfo ) ; $ sectionIndexPlusOne = $ sectionIndex + 1 ; if ( // next section is optional $ sectionIndexPlusOne < $ reverseSectionsCount && ! ( $ reverseSectionsInfo [ $ sectionIndexPlusOne ] -> fixed ) ) { // check if param is really greedy or not $ constraintDefined = isset ( $ constraints [ $ paramName ] ) ; $ constraint = $ constraintDefined ? $ constraints [ $ paramName ] : NULL ; $ greedyReal = ! $ constraintDefined || ( $ constraintDefined && ( mb_strpos ( $ constraint , '.*' ) !== FALSE || mb_strpos ( $ constraint , '.+' ) !== FALSE ) ) ; if ( $ greedyReal ) { $ selfClass = version_compare ( PHP_VERSION , '5.5' , '>' ) ? self :: class : __CLASS__ ; throw new \ InvalidArgumentException ( "[" . $ selfClass . "] Route pattern definition can not have greedy `<param_name*>` with star " . "(to include everything - all characters and slashes . `.*`) immediately before optional " . "section ($this)." ) ; } } $ greedyCaught = TRUE ; $ paramName = str_replace ( '*' , '' , $ paramName ) ; $ sectionIsLast = $ sectionIndexPlusOne === $ reverseSectionsCount ; } return [ $ greedyFlag , $ sectionIsLast ] ; }
Get if founded param place is greedy or not. If it's greedy, check if it
is only one greedy param in whole pattern string and if it is the last
param between other params. Get also if given section index belongs to
the last section info in line.
@param \stdClass[]	$reverseSectionsInfo	Whole sections info array ref.
with `\stdClass` objects.
@param array			$constraints			Route params constraints.
@param string		$paramName				Route parsed params.
@param int			$sectionIndex			Currently checked section index.
@param bool			$greedyCaught			Boolean about if param is checked as greedy.
@throws \InvalidArgumentException Wrong route pattern format.
@return \bool[]		Array with two boolean values. First is greedy flag
and second is about if section is last or not. The
second could be `NULL`
Get if founded param place is greedy or not . If it s greedy check if it is only one greedy param in whole pattern string and if it is the last param between other params . Get also if given section index belongs to the last section info in line .