| Total Complexity | 9 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | trait SitesTrait |
||
| 14 | { |
||
| 15 | /** @var array|null $sites */ |
||
| 16 | protected $sites = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @return array|null |
||
| 20 | */ |
||
| 21 | public function getSites(): ?array |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param array|null $sites |
||
| 28 | */ |
||
| 29 | public function setSites(?array $sites): void |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param array|null $sites |
||
| 36 | */ |
||
| 37 | public function addSites(?array $sites): void |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param array $site |
||
| 50 | */ |
||
| 51 | public function addSite(array $site): void |
||
| 67 |
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.