Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | protected function ensureAllAppendsExist(): bool |
||
37 | { |
||
38 | $appends = $this->request->appends(); |
||
39 | |||
40 | $diff = $appends->diff($this->allowedAppends); |
||
41 | |||
42 | if ($diff->count()) { |
||
43 | if ($this->throwInvalidQueryExceptions) { |
||
44 | throw InvalidAppendQuery::appendsNotAllowed($diff, $this->allowedAppends); |
||
45 | } else { |
||
46 | return false; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return true; |
||
51 | } |
||
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: