Total Complexity | 6 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 91.67% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | final class PingTaskRunner implements TaskRunner |
||
17 | { |
||
18 | /** @var HttpClientInterface */ |
||
19 | private $httpClient; |
||
20 | 3 | ||
21 | public function __construct(?HttpClientInterface $httpClient = null) |
||
22 | 3 | { |
|
23 | if (null === $httpClient && !\class_exists(HttpClient::class)) { |
||
24 | throw new MissingDependency(PingTask::getMissingDependencyMessage()); |
||
25 | } |
||
26 | 3 | ||
27 | 3 | $this->httpClient = $httpClient ?: HttpClient::create(); |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param PingTask $task |
||
32 | 3 | */ |
|
33 | public function __invoke(Task $task): Result |
||
40 | } |
||
41 | 3 | ||
42 | public function supports(Task $task): bool |
||
47 |