| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | public static function http(string $domain, string $token, string $keyAuthorization): void |
||
| 11 | { |
||
| 12 | $httpClient = new Client($domain); |
||
| 13 | |||
| 14 | $response = $httpClient->get($domain . '/.well-known/acme-challenge/' . $token); |
||
| 15 | |||
| 16 | if ($response->getHttpResponseCode() === 200 && $response->getBody() === $keyAuthorization) { |
||
| 17 | return; |
||
| 18 | } |
||
| 19 | |||
| 20 | throw DomainValidationException::localHttpChallengeTestFailed($response->getHttpResponseCode()); |
||
| 21 | } |
||
| 22 | } |