2 declare(strict_types = 1);
19 use Symfony\Component\Routing\CompiledRoute;
20 use Symfony\Component\Routing\Route as SymfonyRoute;
46 array $requirements = [],
51 ?
string $condition =
'',
54 parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
64 return $this->getOption(
'_arguments') ?? [];
74 foreach ($arguments as $key => $argument) {
75 if (isset($mergedArguments[$key])) {
76 throw new \OverflowException(
77 sprintf(
'Cannot override argument %s', $key),
81 $mergedArguments[$key] = $argument;
83 $this->setOption(
'_arguments', $mergedArguments);
91 return $this->getOption(
'_enhancer') ??
null;
129 if (isset($this->aspects[$key])) {
130 throw new \OverflowException(
131 sprintf(
'Cannot override aspect %s', $key),
135 $this->aspects[$key] = $aspect;
137 $this->compiled =
null;
147 public function getAspect(
string $key): ?AspectInterface
149 return $this->aspects[$key] ??
null;
160 return array_key_exists($key, $this->aspects);
170 public function setAspect(
string $key, AspectInterface $aspect): self
172 $this->aspects[$key] = $aspect;
173 $this->compiled =
null;
183 public function filterAspects(array $classNames, array $variableNames = []): array
186 if (empty($classNames) && empty($variableNames)) {
189 if (!empty($variableNames)) {
192 function (
string $variableName) use ($variableNames) {
193 return in_array($variableName, $variableNames,
true);
200 function (AspectInterface $aspect) use ($classNames) {
201 $uses = class_uses($aspect);
202 foreach ($classNames as $className) {
203 if (!is_a($aspect, $className)
204 && !in_array($className, $uses,
true)