Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Validator/Constraints/RouteDefaultsTwigValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
$this->twig = $twig;
}

public function validate($defaults, Constraint $constraint)
public function validate(mixed $value, Constraint $constraint): void
{
if (!$constraint instanceof RouteDefaults) {
throw new \InvalidArgumentException(sprintf('Expected %s, got %s', RouteDefaults::class, get_class($constraint)));
}
if (\array_key_exists('_controller', $defaults) && null !== $defaults['_controller']) {

Check failure on line 39 in src/Validator/Constraints/RouteDefaultsTwigValidator.php

View workflow job for this annotation

GitHub Actions / PHPStan

Undefined variable: $defaults
$controller = $defaults['_controller'];

$request = new Request([], [], ['_controller' => $controller]);
Expand All @@ -48,7 +48,7 @@
}
}

if (null !== $this->twig && \array_key_exists('_template', $defaults) && null !== $defaults['_template']) {

Check failure on line 51 in src/Validator/Constraints/RouteDefaultsTwigValidator.php

View workflow job for this annotation

GitHub Actions / PHPStan

Variable $defaults might not be defined.
$template = $defaults['_template'];

if (false === $this->twig->exists($template)) {
Expand Down
Loading