Example #1
0
 /**
  * @param Context $context
  * @param Route $route
  * @return array
  */
 public function extract(Context $context, Route $route) : array
 {
     $names = $this->getCompiler()->getNames($route->getPattern());
     $regex = $this->getRouteCollection()->getRegex($route->getID());
     $values = $this->getCompiler()->getValues($regex, (string) $context);
     return array_intersect_key($values, array_flip($names)) + $route->getDefaults();
 }