| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public static function microsoftTeamsRespondedWithAnError(ClientException $exception) |
||
| 17 | { |
||
| 18 | if (! $exception->hasResponse()) { |
||
| 19 | return new static('Microsoft Teams responded with an error but no response body found'); |
||
| 20 | } |
||
| 21 | |||
| 22 | $statusCode = $exception->getResponse()->getStatusCode(); |
||
| 23 | $description = $exception->getMessage(); |
||
| 24 | |||
| 25 | return new static("Microsoft Teams responded with an error `{$statusCode} - {$description}`"); |
||
| 26 | } |
||
| 27 | |||
| 50 |