1 | <?php |
||
10 | class Product implements JsonSerializable |
||
11 | { |
||
12 | private $id; |
||
13 | private $images; |
||
14 | private $variants; |
||
15 | private $name; |
||
16 | private $description; |
||
17 | private $notes; |
||
18 | private $creation_datetime; |
||
19 | private $modification_datetime; |
||
20 | |||
21 | /** |
||
22 | * @var Image |
||
23 | */ |
||
24 | private $pendingImage; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $deleteImage; |
||
30 | |||
31 | 3 | public function __construct(array $data = null) |
|
36 | |||
37 | 1 | public function getId(): ?int |
|
41 | |||
42 | 1 | public function getImages(): ?array |
|
46 | |||
47 | 2 | public function getVariants(): ?Variants |
|
51 | |||
52 | 2 | public function getName(): ?string |
|
56 | |||
57 | 2 | public function getDescription(): ?string |
|
61 | |||
62 | 2 | public function getNotes(): ?string |
|
66 | |||
67 | public function getCreationDatetime(): ?DateTime |
||
71 | |||
72 | public function getModificationDatetime(): ?DateTime |
||
76 | |||
77 | 3 | public function reset(array $data = null) |
|
112 | |||
113 | public function deleteImage() |
||
117 | |||
118 | 1 | public function setImage(Image $image = null) |
|
122 | |||
123 | 2 | public function setName(string $name = null) |
|
127 | |||
128 | 2 | public function setDescription(string $description = null) |
|
132 | |||
133 | public function setNotes(string $notes = null) |
||
137 | |||
138 | 2 | public function jsonSerialize() |
|
153 | } |
||
154 |
As per the PSR-2 coding standard, case statements should not be wrapped in curly braces. There is no need for braces, since each case is terminated by the next
break
.There is also the option to use a semicolon instead of a colon, this is discouraged because many programmers do not even know it works and the colon is universal between programming languages.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.