Code Duplication    Length = 11-11 lines in 2 locations

src/PTS/Validator/Validators/AlphaDashValidator.php 1 location

@@ 6-16 (lines=11) @@
3
4
namespace PTS\Validator\Validators;
5
6
class AlphaDashValidator
7
{
8
    public function __invoke($value): bool
9
    {
10
        if (!\is_string($value) && !\is_numeric($value)) {
11
            return false;
12
        }
13
14
        return preg_match('/^[\pL\pM\pN_-]+$/u', $value) > 0;
15
    }
16
}
17

src/PTS/Validator/Validators/AlphaNumValidator.php 1 location

@@ 6-16 (lines=11) @@
3
4
namespace PTS\Validator\Validators;
5
6
class AlphaNumValidator
7
{
8
    public function __invoke($value): bool
9
    {
10
        if (!\is_string($value) && !\is_numeric($value)) {
11
            return false;
12
        }
13
14
        return preg_match('/^[\pL\pM\pN]+$/u', $value) > 0;
15
    }
16
}
17