1 | <?php |
||
8 | trait AppendsAttributesToResults |
||
9 | { |
||
10 | /** @var \Illuminate\Support\Collection */ |
||
11 | protected $allowedAppends; |
||
12 | |||
13 | public function allowedAppends($appends): self |
||
23 | |||
24 | protected function addAppendsToResults(Collection $results) |
||
30 | |||
31 | protected function guardAgainstUnknownAppends() |
||
41 | } |
||
42 |
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: