Skip to content

Commit bb2288f

Browse files
committed
update
1 parent 7164f93 commit bb2288f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Validator/MinLengthValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ class MinLengthValidator implements Validator
77
protected int $minLength;
88
protected string $message = 'Exceeds minimum length';
99

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

1818
public function message(string $message): self

src/Validator/Validators.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function expression(string $comperator, string $value, string $mes
4949
return $validator;
5050
}
5151

52-
public static function minLength(string $minLength, string $message = ''): Validator
52+
public static function minLength(int $minLength, string $message = ''): Validator
5353
{
5454
$validator = new MinLengthValidator($minLength);
5555
if ($message) {

0 commit comments

Comments
 (0)