-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: fix PHPStan notice on PHPStan 2.1.23 #9715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: fix PHPStan notice on PHPStan 2.1.23 #9715
Conversation
|
Ready for review 👍 |
| $request->setGlobal( | ||
| 'request', | ||
| $request->fetchGlobal('post') + $request->fetchGlobal('get'), | ||
| (array) $request->fetchGlobal('post') + (array) $request->fetchGlobal('get'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about it tho...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code, should be fine with this patch, since no 2nd argument as index, means it always array:
CodeIgniter4/system/HTTP/RequestTrait.php
Lines 266 to 277 in 4387f32
| // Return all values when $index is null | |
| if ($index === null) { | |
| $values = []; | |
| foreach ($this->globals[$name] as $key => $value) { | |
| $values[$key] = is_array($value) | |
| ? $this->fetchGlobal($name, $key, $filter, $flags) | |
| : filter_var($value, $filter, $flags); | |
| } | |
| return $values; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be fine here.
michalsn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
@michalsn thank you for the review, let's merge 👍 |
Description
To fix phpstan notice on PHPStan 2.1.23
Checklist: