Refactored ValidationException (-> InvalidArgumentException).

This commit is contained in:
Dmitry Khomutov 2018-03-17 09:24:30 +07:00
commit 2a3adf25af
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
20 changed files with 79 additions and 91 deletions

View file

@ -2,7 +2,7 @@
namespace PHPCensor\Model\Base;
use PHPCensor\Exception\HttpException\ValidationException;
use PHPCensor\Exception\InvalidArgumentException;
use PHPCensor\Model;
class Build extends Model
@ -155,7 +155,7 @@ class Build extends Model
/**
* @param integer $value
*
* @throws ValidationException
* @throws InvalidArgumentException
*
* @return boolean
*/
@ -165,7 +165,7 @@ class Build extends Model
$this->validateInt('status', $value);
if (!in_array($value, $this->allowedStatuses, true)) {
throw new ValidationException(
throw new InvalidArgumentException(
'Column "status" must be one of: ' . join(', ', $this->allowedStatuses) . '.'
);
}
@ -474,7 +474,7 @@ class Build extends Model
/**
* @param integer $value
*
* @throws ValidationException
* @throws InvalidArgumentException
*
* @return boolean
*/
@ -483,7 +483,7 @@ class Build extends Model
$this->validateInt('source', $value);
if (!in_array($value, $this->allowedSources, true)) {
throw new ValidationException(
throw new InvalidArgumentException(
'Column "source" must be one of: ' . join(', ', $this->allowedSources) . '.'
);
}