| Total Complexity | 3 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class NlpRequest extends AbstractRequest implements QueryRequestInterface |
||
| 12 | { |
||
| 13 | use UtilityTrait; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $configs; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * CodeRequest constructor. |
||
| 22 | * |
||
| 23 | * @param string $path |
||
| 24 | * @param array $configs |
||
| 25 | */ |
||
| 26 | 2 | public function __construct(string $path, array $configs) |
|
| 31 | 2 | } |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @param string|null $method |
||
| 35 | * |
||
| 36 | * @return RequestInterface |
||
| 37 | */ |
||
| 38 | 2 | public function build(string $method = 'post'): RequestInterface |
|
| 39 | { |
||
| 40 | 2 | $uri = Uri::fromParts([ |
|
| 41 | 2 | 'path' => $this->origin->getUri()->getPath(), |
|
| 42 | 2 | 'query' => $this->buildQuery(), |
|
| 43 | ]); |
||
| 44 | |||
| 45 | 2 | return $this->origin |
|
| 46 | 2 | ->withMethod($method) |
|
| 47 | 2 | ->withUri($uri); |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 2 | public function buildQuery(): string |
|
| 64 | } |
||
| 65 | } |
||
| 66 |