Skip to content

Commit 779a8c1

Browse files
committed
Code improvements
1 parent d1650a3 commit 779a8c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Constraints/NotInPasswordCommonListValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function validate($value, Constraint $constraint): void
3030
return;
3131
}
3232

33-
if (! \is_scalar($value) && ! (\is_object($value) && method_exists($value, '__toString'))) {
33+
if (! \is_scalar($value) && ! $value instanceof \Stringable) {
3434
throw new UnexpectedValueException($value, 'string');
3535
}
3636

@@ -39,7 +39,7 @@ public function validate($value, Constraint $constraint): void
3939

4040
$passwordFile = __DIR__ . '/../../Resources/common_lists/list-' . mb_strlen($value) . '.php';
4141

42-
if (! file_exists($passwordFile)) {
42+
if (! is_file($passwordFile)) {
4343
return;
4444
}
4545

0 commit comments

Comments
 (0)