| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function purge(array $iris) |
||
| 29 | { |
||
| 30 | if (!$iris) { |
||
|
|
|||
| 31 | return; |
||
| 32 | } |
||
| 33 | |||
| 34 | $hashes = array_map('md5', $iris); |
||
| 35 | $regex = isset($hashes[1]) ? sprintf('(%s)', implode('|', $hashes)) : $hashes[0]; |
||
| 36 | |||
| 37 | $this->guzzle->sendAsync($this->guzzle->request('BAN', '', ['headers' => ['X-Ban-Regex' => $regex]])); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
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.