You are here

private function ApacheUrlMatcher::denormalizeValues in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Matcher/ApacheUrlMatcher.php \Symfony\Component\Routing\Matcher\ApacheUrlMatcher::denormalizeValues()

Denormalizes an array of values.

Parameters

string[] $values:

Return value

array

1 call to ApacheUrlMatcher::denormalizeValues()
ApacheUrlMatcher::match in vendor/symfony/routing/Matcher/ApacheUrlMatcher.php
Tries to match a URL based on Apache mod_rewrite matching.

File

vendor/symfony/routing/Matcher/ApacheUrlMatcher.php, line 108

Class

ApacheUrlMatcher
ApacheUrlMatcher matches URL based on Apache mod_rewrite matching (see ApacheMatcherDumper).

Namespace

Symfony\Component\Routing\Matcher

Code

private function denormalizeValues(array $values) {
  $normalizedValues = array();
  foreach ($values as $key => $value) {
    if (preg_match('~^(.*)\\[(\\d+)\\]$~', $key, $matches)) {
      if (!isset($normalizedValues[$matches[1]])) {
        $normalizedValues[$matches[1]] = array();
      }
      $normalizedValues[$matches[1]][(int) $matches[2]] = $value;
    }
    else {
      $normalizedValues[$key] = $value;
    }
  }
  return $normalizedValues;
}