Passed
Pull Request — master (#46)
by Artem
01:43
created

IncomeClient::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 10
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 readonly class IncomeClient implements \JsonSerializable
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 11 at column 6
Loading history...
12
{
13
    public function __construct(
14
        private ?string $contactPhone = null,
15
        private ?string $displayName = null,
16
        private string $incomeType = IncomeType::INDIVIDUAL,
17
        private ?string $inn = null
18
    ) {}
19
20
    public function jsonSerialize(): array
21
    {
22
        return [
23
            'contactPhone' => $this->contactPhone,
24
            'displayName' => $this->displayName,
25
            'incomeType' => $this->incomeType,
26
            'inn' => $this->inn,
27
        ];
28
    }
29
30
    public function getInn(): ?string
31
    {
32
        return $this->inn;
33
    }
34
35
    public function getIncomeType(): string
36
    {
37
        return $this->incomeType;
38
    }
39
40
    public function getDisplayName(): ?string
41
    {
42
        return $this->displayName;
43
    }
44
45
    public function getContactPhone(): ?string
46
    {
47
        return $this->contactPhone;
48
    }
49
}
50