1 | <?php |
||
7 | trait HasHashables |
||
8 | { |
||
9 | /** |
||
10 | * Get the current hashables for the model. |
||
11 | * |
||
12 | * @return array|null |
||
13 | */ |
||
14 | public function getHashables(): ?array |
||
18 | |||
19 | /** |
||
20 | * Set the hashables associated with the model. |
||
21 | * |
||
22 | * @param array $hashables |
||
23 | * |
||
24 | * @return $this |
||
25 | */ |
||
26 | public function setHashables(array $hashables) |
||
32 | } |
||
33 |
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: