Issues (27)

src/Model/Street.php (1 issue)

Labels
Severity
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 Street
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 10 at column 6
Loading history...
11
{
12 2
    public function __construct(
13
        #[Serializer\Type('int')]
14
        public ?int $id = null,
15
16
        #[Serializer\Type('int')]
17
        public ?int $cityId = null,
18
19
        #[Serializer\Type('string')]
20
        public ?string $name = null,
21
22
        #[Serializer\Type('string')]
23
        public ?string $nameEn = null,
24
    ) {
25 2
    }
26
27 2
    public function toArray(): array
28
    {
29 2
        return [
30 2
            Constants::ID => $this->id,
31 2
            Constants::CITY_ID => $this->cityId,
32 2
            Constants::NAME => $this->name,
33 2
            Constants::NAME_EN => $this->nameEn,
34 2
        ];
35
    }
36
}
37