1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace VasilDakov\Econt\Model; |
||
6 | |||
7 | use JMS\Serializer\Annotation as Serializer; |
||
8 | use VasilDakov\Econt\Constants; |
||
9 | |||
10 | final readonly class ClientProfile |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
11 | { |
||
12 | public function __construct( |
||
13 | #[Serializer\Type('int')] |
||
14 | public ?int $id = null, |
||
15 | |||
16 | #[Serializer\Type('string')] |
||
17 | public ?string $name = null, |
||
18 | |||
19 | #[Serializer\Type('string')] |
||
20 | public ?string $nameEn = null, |
||
21 | |||
22 | #[Serializer\Type('array')] |
||
23 | public ?array $phones = null, |
||
24 | |||
25 | #[Serializer\Type('string')] |
||
26 | public ?string $email = null, |
||
27 | ) { |
||
28 | |||
29 | } |
||
30 | |||
31 | public function toArray(): array |
||
32 | { |
||
33 | return [ |
||
34 | Constants::ID => $this->id, |
||
35 | Constants::NAME => $this->name, |
||
36 | Constants::NAME_EN => $this->nameEn, |
||
37 | Constants::PHONES => $this->phones, |
||
38 | Constants::EMAIL => $this->email, |
||
39 | ]; |
||
40 | } |
||
41 | } |
||
42 |