Company   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

6 Methods

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