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