| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function acceptRequest(): ?array |
||
| 38 | { |
||
| 39 | $body = $this->getWorker()->receive($ctx); |
||
| 40 | if (empty($body) && empty($ctx)) { |
||
| 41 | // termination request |
||
| 42 | return null; |
||
| 43 | } |
||
| 44 | |||
| 45 | $ctx = json_decode($ctx, true); |
||
| 46 | if ($ctx === null) { |
||
| 47 | // invalid context |
||
| 48 | return null; |
||
| 49 | } |
||
| 50 | |||
| 51 | return ['ctx' => $ctx, 'body' => $body]; |
||
| 52 | } |
||
| 53 | |||
| 76 |