-
Notifications
You must be signed in to change notification settings - Fork 950
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
Fix PHP 8.1 deprecation error #1021
Conversation
8cbc0d5
to
944bdb3
Compare
@bshaffer Can you look at? |
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.
@snapshotpl this is causing the tests to fail. that is because there is a $contentType !== null
check a few lines below your change which is now failing when it should succeed. The better solution would be to cast $contentType
to a string when calling strpos
src/OAuth2/TokenType/Bearer.php
Outdated
@@ -108,7 +108,7 @@ public function getAccessTokenParameter(RequestInterface $request, ResponseInter | |||
return null; | |||
} | |||
|
|||
$contentType = $request->server('CONTENT_TYPE'); | |||
$contentType = $request->server('CONTENT_TYPE', ''); | |||
if (false !== $pos = strpos($contentType, ';')) { |
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.
if (false !== $pos = strpos($contentType, ';')) { | |
if (false !== $pos = strpos((string) $contentType, ';')) { |
src/OAuth2/TokenType/Bearer.php
Outdated
@@ -108,7 +108,7 @@ public function getAccessTokenParameter(RequestInterface $request, ResponseInter | |||
return null; | |||
} | |||
|
|||
$contentType = $request->server('CONTENT_TYPE'); | |||
$contentType = $request->server('CONTENT_TYPE', ''); |
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.
$contentType = $request->server('CONTENT_TYPE', ''); | |
$contentType = $request->server('CONTENT_TYPE'); |
944bdb3
to
b7e2bdf
Compare
Found when test on PHP 8.1 here https://github.com/laminas-api-tools/api-tools-oauth2/runs/6385928373?check_suite_focus=true#step:3:677