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
Psalm fixes 3 #17221
Psalm fixes 3 #17221
Conversation
a53f6cc
to
9f5d335
Compare
Codecov Report
@@ Coverage Diff @@
## master #17221 +/- ##
=========================================
Coverage ? 49.01%
Complexity ? 16715
=========================================
Files ? 579
Lines ? 60499
Branches ? 0
=========================================
Hits ? 29656
Misses ? 30843
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a2674c8
to
d0fc681
Compare
@@ -102,7 +102,7 @@ private function handleContext(array $context) | |||
]; | |||
if (strlen($this->proxyUser) > 0) { | |||
$auth = base64_encode($this->proxyUser . ':' . $this->proxyPass); | |||
$context['http']['header'] .= 'Proxy-Authorization: Basic ' | |||
$context['http']['header'] = 'Proxy-Authorization: Basic ' |
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.
I already reviewed this while checking code mistakes
I am not sure it should be changed
There was something that made this concat sill have some sense
Not sure what
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.
Ok, I will check it more carefully. I wasn't actually bothered to set up an environment for this to test as I need to disable CURL and enable allow_url_fopen
. Let me see if it really throws an error as I'd expect it to.
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.
I checked it and when using concatenation it throws Undefined array key "header"
error. Maybe in the past the code looked different and the concatenation made sense. As of now, I can't see any possibility that the code does not throw a warning.
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.
Thank you
If I remember maybe this code is a bug because it would erase all the other headers
Not sure anymore
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.
I agree that this looks like a bug. But if it is a bug then I do not know what was the desired behaviour. The name of the method is handleContext
which doesn't tell us much about what the method should do. Let's remove the concatenation for now, and if someone wants to study this code in the future, they can fix the logic.
9cae93d
to
f371ac1
Compare
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
The two globals in this method are read-only. There is an unused parameter in the signature. Let's add one more and use them instead of globals. Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
f371ac1
to
053c98b
Compare
Merged, thanks for your contribution! |
This is a collection of random fixes found through Psalm analysis