Skip to content

Commit 002d8e5

Browse files
authored
fix(validation): ValidationException causes TypeError exception when called with $code=null (#6375)
1 parent d809315 commit 002d8e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Validator/Exception/ValidationException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct(string|ConstraintViolationListInterface $message = '
8181
}
8282

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

8787
/**

0 commit comments

Comments
 (0)