You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ParameterBag stub the return type is improperly narrowed to list<string>.
The implementation use a simple array_keys call. Therefore the return type MUST be list<array-key>.
With the current type narrowing it's impossible to correctly parse a query string with numeric keys (ie: https://domain.tld/search?0=value&78=something). Worse, trusting PHPStan than the key is a string might lead to a runtime TypeError.
The text was updated successfully, but these errors were encountered:
nreynis
changed the title
ParameterBag->keys return type is incorrectParameterBag->keys() return type is incorrect
Apr 7, 2025
In the
ParameterBag
stub the return type is improperly narrowed tolist<string>
.The implementation use a simple
array_keys
call. Therefore the return type MUST belist<array-key>
.With the current type narrowing it's impossible to correctly parse a query string with numeric keys (ie:
https://domain.tld/search?0=value&78=something
). Worse, trusting PHPStan than the key is a string might lead to a runtimeTypeError
.The text was updated successfully, but these errors were encountered: