InvoiceClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 7 1
A __construct() 0 10 1
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 InvoiceClient 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