Completed
Push — master ( 9061cf...d4ded0 )
by Sullivan
08:23 queued 05:46
created

PhoneNumber::getIsoCodesClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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 ANY = 'any';
16
17
    /**
18
     * @var string
19
     *
20
     * Using PhoneNumber::ANY option will valid phone numbers with only country code prefixes (e.g. +33).
21
     *
22
     * For the avaible country, @see \libphonenumber\PhoneNumberUtil::isValidRegionCode
23
     */
24
    public $country = self::ANY;
25
26
    public $message = 'This value is not a valid phone number.';
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function __construct($options = null)
32
    {
33
        parent::__construct($options);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getIsoCodesVersion()
40
    {
41
        return '2.1.0';
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getIsoCodesClass()
48
    {
49
        return \IsoCodes\PhoneNumber::class;
50
    }
51
}
52