| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | public function addSite(array $site): void |
||
| 52 | { |
||
| 53 | if (isset( |
||
| 54 | $site[Configuration::SITES_SITE], |
||
| 55 | $site[Configuration::SITES_URL], |
||
| 56 | $site[Configuration::SITES_TOKEN] |
||
| 57 | )) { |
||
| 58 | foreach ($this->sites as $thisSite) { |
||
| 59 | if ($thisSite[Configuration::SITES_SITE] === $site[Configuration::SITES_SITE]) { |
||
| 60 | return ; |
||
| 61 | } |
||
| 62 | } |
||
| 63 | $this->sites[] = $site; |
||
| 64 | } |
||
| 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.