Completed
Pull Request — develop (#9)
by Daan van
16:17 queued 13:29
created

TelephoneNumber   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 39
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A equals() 0 4 1
A getTelephoneNumber() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace OpenConext\Value\Saml\Metadata\ContactPerson;
4
5
use OpenConext\Value\Assert\Assertion;
6
7
final class TelephoneNumber
8
{
9
    /**
10
     * @var string
11
     */
12
    private $telephoneNumber;
13
14
    /**
15
     * @param string $telephoneNumber
16
     */
17
    public function __construct($telephoneNumber)
18
    {
19
        Assertion::nonEmptyString($telephoneNumber, 'telephoneNumber');
20
21
        $this->telephoneNumber = $telephoneNumber;
22
    }
23
24
    /**
25
     * @param TelephoneNumber $other
26
     * @return bool
27
     */
28
    public function equals(TelephoneNumber $other)
29
    {
30
        return $this->telephoneNumber === $other->telephoneNumber;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getTelephoneNumber()
37
    {
38
        return $this->telephoneNumber;
39
    }
40
41
    public function __toString()
42
    {
43
        return $this->telephoneNumber;
44
    }
45
}
46