Query strings and type safety
Query strings are usually strings, but - as some might not be aware of - can also be quite easily an array. So not checking on the type and blindly using it in stringish operations can currently cause undesired results.
$result = 'string' . $this->request->query('key'); // Dangerous without checking if set and a stringSo with the current implementation of how query strings (and named params) work, one should always assert the correct type first:
$key = $this->request->query('key'); if (is_array($key)) { // Or: if (!is_scalar($key)) throw new NotFoundException('Invalid query string'); // Simple 404 } $result = 'string' . $this->request->query('key'); // Dangerous without checking if a stringish (=scalar) valueAnnoying - I know. That's why I opened a ticket regarding this issue.
Demo/Example
Result:Array ( [key] => value )
A simple string A simple array