Completed
Push — master ( 82906d...60674b )
by Hannes
02:52
created

Alphanum::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace byrokrat\autogiro\Matcher;
6
7
/**
8
 * Matcher for alphanumeric content
9
 */
10
class Alphanum extends BaseMatcher
11
{
12
    protected function getDescription(): string
13
    {
14
        return 'alphanum';
15
    }
16
17
    protected function isMatch(string $str): bool
18
    {
19
        return !!preg_match('/^[A-Za-zÅÄÖåäö 0-9]*$/', $str);
20
    }
21
}
22