Discover::getPattern()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Jgxvx\Common\Validator\CreditCardNumber;
4
5
/**
6
 * Credit card number regex found on Stack Overflow.
7
 *
8
 * @link http://stackoverflow.com/a/23231321
9
 */
10
class Discover extends AbstractValidator
11
{
12
13 1
    protected function getPattern() : string
14
    {
15 1
        return '/^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$/';
16
    }
17
}
18