Completed
Push — feature/more-metadata-values ( 439c1e...033bf1 )
by Daan van
03:58 queued 02:14
created

Company::equals()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace OpenConext\Value\Saml\Metadata\ContactPerson;
4
5
use OpenConext\Value\Exception\InvalidArgumentException;
6
7
final class Company
8
{
9
    /**
10
     * @var string
11
     */
12
    private $company;
13
14
    /**
15
     ** @param string $company
16
     */
17
    public function __construct($company)
18
    {
19
        if (!is_string($company) || trim($company) === '') {
20
            throw InvalidArgumentException::invalidType('non-blank string', 'company', $company);
21
        }
22
23
        $this->company = $company;
24
    }
25
26
    /**
27
     * @param Company $other
28
     * @return bool
29
     */
30
    public function equals(Company $other)
31
    {
32
        return $this->company === $other->company;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getCompany()
39
    {
40
        return $this->company;
41
    }
42
43
    public function __toString()
44
    {
45
        return $this->company;
46
    }
47
}
48