| Total Complexity | 6 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | final class PingTask extends Task implements HasMissingDependencyMessage |
||
| 12 | { |
||
| 13 | /** @var string */ |
||
| 14 | private $url; |
||
| 15 | |||
| 16 | /** @var string */ |
||
| 17 | private $method; |
||
| 18 | |||
| 19 | /** @var array */ |
||
| 20 | 7 | private $options; |
|
| 21 | |||
| 22 | 7 | /** |
|
| 23 | 7 | * @param array $options See HttpClientInterface::OPTIONS_DEFAULTS |
|
| 24 | 7 | */ |
|
| 25 | public function __construct(string $url, string $method = 'GET', array $options = []) |
||
| 26 | 7 | { |
|
| 27 | 7 | $this->url = $url; |
|
| 28 | $this->method = $method; |
||
| 29 | $this->options = $options; |
||
| 30 | |||
| 31 | parent::__construct("Ping {$url}"); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getContext(): array |
||
| 35 | { |
||
| 36 | return [ |
||
| 37 | 'Url' => $this->url, |
||
| 38 | 5 | 'Method' => $this->method, |
|
| 39 | 'Options' => \json_encode($this->options), |
||
| 40 | 5 | ]; |
|
| 41 | } |
||
| 42 | |||
| 43 | 5 | public function getUrl(): string |
|
| 44 | { |
||
| 45 | 5 | return $this->url; |
|
| 46 | } |
||
| 47 | |||
| 48 | 5 | public function getMethod(): string |
|
| 51 | } |
||
| 52 | |||
| 53 | public function getOptions(): array |
||
| 56 | } |
||
| 57 | |||
| 58 | public static function getMissingDependencyMessage(): string |
||
| 61 | } |
||
| 62 | } |
||
| 63 |