| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class QueryParameters |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The Request object. |
||
| 11 | * |
||
| 12 | * @var \Psr\Http\Message\RequestInterface |
||
| 13 | */ |
||
| 14 | protected $request; |
||
| 15 | |||
| 16 | public static function create(RequestInterface $request) |
||
| 17 | { |
||
| 18 | return new static($request); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Initialize the class. |
||
| 23 | * |
||
| 24 | * @param \Psr\Http\Message\RequestInterface $request |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | public function __construct(RequestInterface $request) |
||
| 28 | { |
||
| 29 | $this->request = $request; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get all query parameters. |
||
| 34 | * |
||
| 35 | * @return array |
||
| 36 | */ |
||
| 37 | public function all(): array |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get a specific query parameter. |
||
| 48 | * |
||
| 49 | * @param string $name |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function get(string $name): string |
||
| 55 | } |
||
| 56 | } |
||
| 57 |