Skip to content

Commit

Permalink
fix(validation): ValidationException causes TypeError exception when …
Browse files Browse the repository at this point in the history
…called with $code=null (#6375)
  • Loading branch information
KernelMrex authored May 21, 2024
1 parent d809315 commit 002d8e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Validator/Exception/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __construct(string|ConstraintViolationListInterface $message = '
}

trigger_deprecation('api_platform/core', '3.3', sprintf('The "%s" exception will have a "%s" first argument in 4.x.', self::class, ConstraintViolationListInterface::class));
parent::__construct($message ?: $this->__toString(), $code, $previous);
parent::__construct($message ?: $this->__toString(), $code ?? 0, $previous);
}

/**
Expand Down

0 comments on commit 002d8e5

Please sign in to comment.