2 declare(strict_types = 1);
56 $this->
namespace = $this->configuration['namespace'] ?? '';
66 $parameters = array_intersect_key(
68 array_flip($route->compile()->getPathVariables())
71 $internals = array_diff_key($results, $parameters);
72 $matchedVariableNames = array_keys($parameters);
74 $staticMappers = $route->
filterAspects([StaticMappableAspectInterface::class], $matchedVariableNames);
75 $dynamicCandidates = array_diff_key($parameters, $staticMappers);
85 $page = $route->getOption(
'_page');
86 $pageId = (int)($page[
'l10n_parent'] > 0 ? $page[
'l10n_parent'] : $page[
'uid']);
88 if ($page[
'MPvar'] ??
'') {
89 $routeArguments[
'MP'] = $page[
'MPvar'];
91 $type = $this->
resolveType($route, $remainingQueryParameters);
92 return new PageArguments($pageId, $type, $routeArguments, $staticArguments, $remainingQueryParameters);
101 $defaultPageRoute = $collection->get(
'default');
102 $variant = $this->
getVariant($defaultPageRoute, $this->configuration);
103 $collection->add(
'enhancer_' . $this->
namespace . spl_object_hash($variant), $variant);
121 $variant = clone $defaultPageRoute;
122 $variant->setPath(rtrim($variant->getPath(),
'/') .
'/' . ltrim($routePath,
'/'));
123 $variant->addOptions([
'_enhancer' => $this,
'_arguments' => $arguments]);
128 $this->
applyRequirements($variant, $this->configuration[
'requirements'] ?? [], $this->
namespace);
138 if (!is_array($parameters[$this->
namespace])) {
142 $defaultPageRoute = $collection->get(
'default');
143 $variant = $this->
getVariant($defaultPageRoute, $this->configuration);
144 $compiledRoute = $variant->compile();
147 $variables = array_flip($compiledRoute->getPathVariables());
148 $mergedParams = array_replace($variant->getDefaults(), $deflatedParameters);
150 if ($variables === [] || array_diff_key($variables, $mergedParams) !== []) {
153 $variant->addOptions([
'deflatedParameters' => $deflatedParameters]);
154 $collection->add(
'enhancer_' . $this->
namespace . spl_object_hash($variant), $variant);
166 foreach ($this->configuration[
'requirements'] ?? [] as $name => $value) {
167 $requirements[$this->
namespace . '_' . $name] = $value;
169 return $requirements;
182 $route->getArguments()