Closed sdecandelario closed 4 years ago
getParams from \Slim\Http\Request
In the latest version of slim/http
the signature of ServerRequest::getParams
looks like this:
/**
* Fetch associative array of body and query string parameters.
*
* Note: This method is not part of the PSR-7 standard.
*
* @return mixed[]
*/
public function getParams(): array
But I could not find a Request::getParams
method in slim/http
.
A Phpstan scan didn't give me any errors.
Do you use Slim 3 or Slim 4?
Sorry, I forgot to put the version we are using. We are in the version 3.11.0
for the moment
Here is the line in 3.11.0
and 3.12.3
3.11.0 https://github.com/slimphp/Slim/blob/3.11.0/Slim/Http/Request.php#L1207 3.12.3 https://github.com/slimphp/Slim/blob/3.12.3/Slim/Http/Request.php#L1189
That's actually an error. We should fix that, it can only return an array.
Hello, In my project we use PHPStan for the static analysis, and throw me an error from the method
getParams
from\Slim\Http\Request
because say the method can return null or array.But i reviewd the two returns of the method and in both only return an array, that are or
$onlyParams
or$params
, is the PHPDocreturn
wrong?