Skip to content

Commit

Permalink
php 8.1 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Apr 28, 2024
1 parent ef38527 commit 5e63b1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Symfony/Validator/State/ParameterValidatorProvider.php
Expand Up @@ -26,11 +26,11 @@
*
* @experimental
*/
final readonly class ParameterValidatorProvider implements ProviderInterface
final class ParameterValidatorProvider implements ProviderInterface
{
public function __construct(
private ProviderInterface $decorated,
private ValidatorInterface $validator
private readonly ProviderInterface $decorated,
private readonly ValidatorInterface $validator
) {
}

Expand All @@ -42,7 +42,7 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
}

$operation = $context['request']->attributes->get('_api_operation');
foreach ($operation->getParameters() as $parameter) {
foreach ($operation->getParameters() ?? [] as $parameter) {
if (!$constraints = $parameter->getConstraint()) {
continue;
}
Expand Down

0 comments on commit 5e63b1e

Please sign in to comment.