MobileVN   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A pregFormat() 0 12 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 MobileVN extends AbstractStaticRegexRule
16
{
17
    public static function pregFormat(): string
18
    {
19
        return strtr('~^(\+?84|0)(::head::)\d{7}$~', [
20
            '::head::' => implode('|', [
21
                '3[2-9]',
22
                '5[2689]',
23
                '7[06-9]',
24
                '8[1-9]',
25
                '9[0-9]',
26
            ]),
27
        ]);
28
    }
29
}
30