Passed
Pull Request — master (#46)
by Artem
13:08
created

InvoiceClient::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
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 InvoiceClient 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