IncomeClient::getDisplayName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoman4eg\Nalog\DTO;
5
6
use Shoman4eg\Nalog\Enum\IncomeType;
7
8
/**
9
 * @author Artem Dubinin <[email protected]>
10
 */
11
final class IncomeClient implements \JsonSerializable
12
{
13
    private ?string $contactPhone;
14
    private ?string $displayName;
15
    private string $incomeType;
16
    private ?string $inn;
17
18
    public function __construct(
19
        ?string $contactPhone = null,
20
        ?string $displayName = null,
21
        string $incomeType = IncomeType::INDIVIDUAL,
22
        ?string $inn = null
23
    ) {
24
        $this->contactPhone = $contactPhone;
25
        $this->displayName = $displayName;
26
        $this->incomeType = $incomeType;
27
        $this->inn = $inn;
28
    }
29
30
    public function jsonSerialize(): array
31
    {
32
        return [
33
            'contactPhone' => $this->contactPhone,
34
            'displayName' => $this->displayName,
35
            'incomeType' => $this->incomeType,
36
            'inn' => $this->inn,
37
        ];
38
    }
39
40
    public function getInn(): ?string
41
    {
42
        return $this->inn;
43
    }
44
45
    public function getIncomeType(): string
46
    {
47
        return $this->incomeType;
48
    }
49
50
    public function getDisplayName(): ?string
51
    {
52
        return $this->displayName;
53
    }
54
}
55