| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0078 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 3 | public function show(string $url) |
|
| 26 | { |
||
| 27 | 3 | Assert::stringNotEmpty($url); |
|
| 28 | 3 | Assert::regex($url, '@https://.*mailgun\.(net|org)/v.+@'); |
|
| 29 | 2 | Assert::regex($url, '|/attachments/[0-9]+|'); |
|
| 30 | |||
| 31 | 1 | $response = $this->httpGet($url); |
|
| 32 | |||
| 33 | 1 | if (200 !== $response->getStatusCode()) { |
|
| 34 | $this->handleErrors($response); |
||
| 35 | } |
||
| 36 | |||
| 37 | 1 | return $response; |
|
| 38 | } |
||
| 39 | } |
||
| 40 |