LandLineVN   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A pregFormat() 0 17 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/validation
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace PHPViet\Validation\Rules;
10
11
/**
12
 * @author Vuong Minh <[email protected]>
13
 * @since 1.0.0
14
 */
15
class LandLineVN extends AbstractStaticRegexRule
16
{
17
    public static function pregFormat(): string
18
    {
19
        return strtr('~^(\+?84|0)(::head::)\d{7}$~', [
20
            '::head::' => implode('|', [
21
                '20[3-9]',
22
                '21[0-689]',
23
                '22[0-25-9]',
24
                '23[2-9]',
25
                '24[0-9]',
26
                '25[124-9]',
27
                '26[0-39]',
28
                '27[0-7]',
29
                '28[0-9]',
30
                '29[0-4679]',
31
            ]),
32
        ]);
33
    }
34
}
35