| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | protected function performAction(array $data = []): bool |
||
| 47 | { |
||
| 48 | if (!$data) { |
||
|
|
|||
| 49 | $this->handleFailResponse("No data."); |
||
| 50 | } |
||
| 51 | |||
| 52 | if ($this->hasEventHandlers(self::EVENT_RECEIVE_WEBHOOK)) { |
||
| 53 | $this->trigger( |
||
| 54 | self::EVENT_RECEIVE_WEBHOOK, |
||
| 55 | new ReceiveWebhookEvent([ |
||
| 56 | 'data' => $data |
||
| 57 | ]) |
||
| 58 | ); |
||
| 59 | } |
||
| 60 | |||
| 61 | $this->handleSuccessResponse(null); |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
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.