1 | <?php |
||
9 | trait AppendsAttributesToResults |
||
10 | { |
||
11 | /** @var \Illuminate\Support\Collection */ |
||
12 | protected $allowedAppends; |
||
13 | |||
14 | public function allowedAppends($appends): self |
||
24 | |||
25 | protected function addAppendsToResults(Collection $results) |
||
35 | |||
36 | protected function ensureAllAppendsExist(): bool |
||
52 | } |
||
53 |
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: