| 1 | <?php |
||
| 15 | class ValueObjectExample |
||
| 16 | { |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | public $scalarValue = "lorem ipsum"; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | public $lorem = "ipsum"; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | public $dolor = 123; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var mixed|null |
||
| 35 | */ |
||
| 36 | public $sit; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var mixed|null |
||
| 40 | */ |
||
| 41 | private $amet; |
||
| 42 | |||
| 43 | public function __construct(string $scalarValue, string $lorem = "ipsum", int $dolor = 123) |
||
| 49 | |||
| 50 | public static function createFromJson(string $json) |
||
| 56 | |||
| 57 | public function serializeJson() |
||
| 61 | |||
| 62 | public function setAmet($amet) |
||
| 66 | |||
| 67 | public function getAmet() |
||
| 71 | |||
| 72 | } |
||
| 73 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.