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