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