| 1 | <?php |
||
| 4 | class URLEncodedQueryStringRequestData implements RequestData { |
||
| 5 | |||
| 6 | protected $queryString; |
||
| 7 | |||
| 8 | protected $parsedData = []; |
||
| 9 | |||
| 10 | public function __construct($queryString) { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Returns the raw data that the requestData tried to parse |
||
| 17 | * @return string |
||
| 18 | */ |
||
| 19 | public function getRawData(): string { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Attempts to get a specific key from the parsed data. Returns NULL if non-existant key (use has($key) if |
||
| 25 | * there is a difference between a null value and a missing value) |
||
| 26 | * WARNING: Parsed data is not sanitized, and should be treated as regular user data |
||
| 27 | * @param string $key |
||
| 28 | * @return mixed |
||
| 29 | */ |
||
| 30 | public function get(string $key) { |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Attempts to find a specific key in the parsed data. Returns true if found else false |
||
| 36 | * @param string $key |
||
| 37 | * @return mixed |
||
| 38 | */ |
||
| 39 | public function has(string $key): bool { |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Gets all parsed data as an associative array |
||
| 45 | * WARNING: Parsed data is not sanitized, and should be treated as regular user data |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public function getAllAsAssociativeArray(): array { |
||
| 51 | } |
||
| 52 |