lithium\analysis\Parser::_prepareMatchParams()

protected static method

Helper function to normalize parameters for token matching.

Parameters

  • array|string $parameters

    Params to be normalized.

Returns

array

Normalized parameters.

Source

	protected static function _prepareMatchParams($parameters) {
		foreach (Set::normalize($parameters) as $token => $scope) {
			if (strpos($token, 'T_') !== 0) {
				unset($parameters[$token]);

				foreach (['before', 'after'] as $key) {
					if (!isset($scope[$key])) {
						continue;
					}
					$items = [];

					foreach ((array) $scope[$key] as $item) {
						$items[] = (strpos($item, 'T_') !== 0)  ? static::token($item) : $item;
					}
					$scope[$key] = $items;
				}
				$parameters[static::token($token)] = $scope;
			}
		}
		return $parameters;
	}