Completed
Push — phonenumber ( a83019...70d761 )
by Sullivan
02:26
created

PhoneNumber   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getIsoCodesVersion() 0 4 1
A getIsoCodesClass() 0 4 1
1
<?php
2
3
namespace SLLH\IsoCodesValidator\Constraints;
4
5
use SLLH\IsoCodesValidator\AbstractConstraint;
6
7
/**
8
 * @Annotation
9
 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
10
 *
11
 * @author Sullivan Senechal <[email protected]>
12
 */
13
final class PhoneNumber extends AbstractConstraint
14
{
15
    const ALL = 'all';
16
17
    public $country = self::ALL;
18
19
    public $message = 'This value is not a valid phone number.';
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function __construct($options = null)
25
    {
26
        parent::__construct($options);
27
28
        // TODO: Check if country is available as for ZipCode.
0 ignored issues
show
Coding Style Best Practice introduced by
Comments for TODO tasks are often forgotten in the code; it might be better to use a dedicated issue tracker.
Loading history...
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getIsoCodesVersion()
35
    {
36
        return '2.1.0';
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getIsoCodesClass()
43
    {
44
        return \IsoCodes\PhoneNumber::class;
45
    }
46
}
47