TelephoneNumber::getTelephoneNumber()   A
last analyzed

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 OpenConext\Value\Saml\Metadata\ContactPerson;
4
5
use OpenConext\Value\Assert\Assertion;
6
use OpenConext\Value\Serializable;
7
8
final class TelephoneNumber implements Serializable
9
{
10
    /**
11
     * @var string
12
     */
13
    private $telephoneNumber;
14
15
    /**
16
     * @param string $telephoneNumber
17
     */
18
    public function __construct($telephoneNumber)
19
    {
20
        Assertion::nonEmptyString($telephoneNumber, 'telephoneNumber');
21
22
        $this->telephoneNumber = $telephoneNumber;
23
    }
24
25
    /**
26
     * @param TelephoneNumber $other
27
     * @return bool
28
     */
29
    public function equals(TelephoneNumber $other)
30
    {
31
        return $this->telephoneNumber === $other->telephoneNumber;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getTelephoneNumber()
38
    {
39
        return $this->telephoneNumber;
40
    }
41
42
    public static function deserialize($data)
43
    {
44
        return new self($data);
45
    }
46
47
    public function serialize()
48
    {
49
        return $this->telephoneNumber;
50
    }
51
52
    public function __toString()
53
    {
54
        return $this->telephoneNumber;
55
    }
56
}
57