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