| 1 | <?php |
||
| 8 | trait HasFiltersTrait |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Get data filters for the element |
||
| 13 | * |
||
| 14 | * @return array |
||
| 15 | */ |
||
| 16 | 11 | public function getFilters() |
|
| 20 | |||
| 21 | /** |
||
| 22 | * Sets data filter for the element |
||
| 23 | * |
||
| 24 | * @param array $filters |
||
| 25 | * |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | 3 | public function setFilters($filters = array()) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Attached the element's data filters to the filtrator object |
||
| 37 | * |
||
| 38 | * @param InputFilter $input |
||
| 39 | * |
||
| 40 | * @throws \InvalidArgumentException |
||
| 41 | */ |
||
| 42 | 9 | protected function prepareFiltrator(InputFilter $input) |
|
| 56 | |||
| 57 | } |
||
| 58 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.