| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Query implements RequestInterface |
||
| 9 | { |
||
| 10 | const ENDPOINT = '/query/'; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $queryString; |
||
| 16 | |||
| 17 | 4 | public function __construct(string $queryString) |
|
| 18 | { |
||
| 19 | 4 | $this->queryString = $queryString; |
|
| 20 | 4 | } |
|
| 21 | |||
| 22 | 4 | public function getEndpoint(): string |
|
| 23 | { |
||
| 24 | 4 | return sprintf( |
|
| 25 | 4 | '%s?%s', |
|
| 26 | 4 | self::ENDPOINT, |
|
| 27 | 4 | http_build_query(['q' => $this->queryString], null, '&') |
|
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | 3 | public function getMethod(): RequestMethod |
|
| 32 | { |
||
| 33 | 3 | return RequestMethod::GET(); |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | public function getParams(): array |
|
| 39 | } |
||
| 40 | |||
| 41 | 3 | public function getContentType(): ContentType |
|
| 44 | } |
||
| 45 | } |
||
| 46 |