Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function __construct($text, callable $selectAction, $data = [], $showItemExtra = false, $disabled = false) |
||
29 | { |
||
30 | Assertion::string($text); |
||
31 | |||
32 | $this->text = $text; |
||
33 | $this->data = $data; |
||
|
|||
34 | $this->selectAction = $selectAction; |
||
35 | $this->showItemExtra = (bool) $showItemExtra; |
||
36 | $this->disabled = $disabled; |
||
37 | } |
||
38 | |||
69 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: