Skip to content

Commit 528cee0

Browse files
committed
update
1 parent f06d15c commit 528cee0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Validator/MaxLengthValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ class MaxLengthValidator implements Validator
77
protected int $maxLength;
88
protected string $message = 'Exceeds maximum length';
99

10-
public function __construct(string $maxLength)
10+
public function __construct(int $maxLength)
1111
{
12-
if (!is_numeric($maxLength) || intval($maxLength) < 0) {
12+
if ($maxLength < 0) {
1313
throw new \InvalidArgumentException('Max length must be a non-negative integer');
1414
}
1515
$this->maxLength = intval($maxLength);

src/Validator/Validators.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function minLength(string $minLength, string $message = ''): Valid
5858
return $validator;
5959
}
6060

61-
public static function maxLength(string $maxLength, string $message = ''): Validator
61+
public static function maxLength(int $maxLength, string $message = ''): Validator
6262
{
6363
$validator = new MaxLengthValidator($maxLength);
6464
if ($message) {

0 commit comments

Comments
 (0)