Completed
Push — master ( 913de5...7ff0dd )
by Jonas
21s queued 11s
created

StatusReason   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A getLanguage() 0 4 1
A getReason() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace CultuurNet\UDB3\Event\ValueObjects;
4
5
use CultuurNet\UDB3\Model\ValueObject\Translation\Language;
6
use InvalidArgumentException;
7
8
final class StatusReason
9
{
10
    /**
11
     * @var Language
12
     */
13
    private $language;
14
15
    /**
16
     * @var string
17
     */
18
    private $reason;
19
20
    public function __construct(Language $language, string $reason)
21
    {
22
        if (empty($reason)) {
23
            throw new InvalidArgumentException('The reason string can\'t be empty.');
24
        }
25
26
        $this->language = $language;
27
        $this->reason = $reason;
28
    }
29
30
    public function getLanguage(): Language
31
    {
32
        return $this->language;
33
    }
34
35
    public function getReason(): string
36
    {
37
        return $this->reason;
38
    }
39
}
40