Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from fd6130/bug_fix
Browse files Browse the repository at this point in the history
[DtoValidator] Fix incorrect parameter when throwing exception
  • Loading branch information
fd6130 authored Oct 12, 2021
2 parents 166da71 + fb7d946 commit e0c7817
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/Dto/Validator/DtoValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function validate(DtoRequestInterface $dto)
$errorMessages [] = $error->getPropertyPath() . ' => ' . $error->getMessage();
}

throw new DtoValidationException($errorMessages);
throw new DtoValidationException('', $errorMessages);
}
}
}
3 changes: 0 additions & 3 deletions src/Exception/DtoValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ class DtoValidationException extends HttpException
{
protected $context = [];

/**
* @param string|array $message
*/
public function __construct(?string $message = '', array $context = [])
{
$message = !empty($message) ? $message : 'DTO validation fail.';
Expand Down

0 comments on commit e0c7817

Please sign in to comment.