| Total Complexity | 3 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class UserRequest extends AbstractRequest implements QueryRequestInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $fields; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * UserRequest constructor. |
||
| 19 | * |
||
| 20 | * @param string $path |
||
| 21 | * @param array $fields |
||
| 22 | */ |
||
| 23 | 2 | public function __construct(string $path, array $fields) |
|
| 28 | 2 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $method |
||
| 32 | * |
||
| 33 | * @return RequestInterface |
||
| 34 | */ |
||
| 35 | 2 | public function build(string $method = 'post'): RequestInterface |
|
| 36 | { |
||
| 37 | 2 | $uri = Uri::fromParts([ |
|
| 38 | 2 | 'path' => $this->origin->getUri()->getPath(), |
|
| 39 | 2 | 'query' => $this->buildQuery(), |
|
| 40 | ]); |
||
| 41 | |||
| 42 | 2 | return $this->origin |
|
| 43 | 2 | ->withUri($uri); |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 2 | public function buildQuery(): string |
|
| 58 | } |
||
| 59 | } |
||
| 60 |