1 | <?php declare(strict_types=1); |
||
12 | class Entity |
||
13 | { |
||
14 | /** |
||
15 | * Magic container |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | private $_data = []; |
||
20 | |||
21 | /** |
||
22 | * Get all fields |
||
23 | * |
||
24 | * @return array |
||
25 | */ |
||
26 | 2 | public function getData(): array |
|
30 | |||
31 | /** |
||
32 | * @param string $name |
||
33 | * @return mixed|null |
||
34 | */ |
||
35 | 7 | public function __get(string $name) |
|
39 | |||
40 | /** |
||
41 | * @param string $name |
||
42 | * @param $value |
||
43 | */ |
||
44 | 10 | public function __set(string $name, $value)//: void 7.1 |
|
48 | |||
49 | /** |
||
50 | * @param string $name |
||
51 | * @return bool |
||
52 | */ |
||
53 | 1 | public function __isset(string $name): bool |
|
57 | |||
58 | /** |
||
59 | * @param string $name |
||
60 | */ |
||
61 | 1 | public function __unset(string $name)//: void 7.1 |
|
65 | |||
66 | /** |
||
67 | * Magic setters and getters |
||
68 | * |
||
69 | * @param $name |
||
70 | * @param $arguments |
||
71 | * @return bool|mixed|null |
||
72 | */ |
||
73 | 4 | public function __call($name, $arguments) |
|
88 | } |
||
89 |
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.