-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add PHP >=8.1 compatibility #75
base: main
Are you sure you want to change the base?
Conversation
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.
fix bugs in library
can you explain which bugs have been fixed?
I only saw code style and php compatibility fixes in the review except the place I commented.
@@ -1629,7 +1628,7 @@ private function pipeline() | |||
|
|||
$operations[] = new CompileHPKP($this->hpkp, $this->hpkpro); | |||
|
|||
$operations[] = new RemoveCookies(array_keys($this->removedCookies)); | |||
$operations[] = new RemoveCookies($this->removedCookies); |
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.
why is this changed?
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.
This is bug.
@@ -1730,7 +1729,7 @@ private function cspAllow( | |||
$reportOnly = null | |||
) { | |||
Types::assert( | |||
['string' => [$friendlyDirective, $friendlySource]] | |||
['?string' => [$friendlyDirective, $friendlySource]] |
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.
This is bug.
@@ -1749,9 +1748,9 @@ private function cspAllow( | |||
*/ | |||
private function longDirective($friendlyDirective) | |||
{ | |||
Types::assert(['string' => [$friendlyDirective]]); | |||
Types::assert(['?string' => [$friendlyDirective]]); |
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.
This is bug.
|
||
$friendlyDirective = strtolower($friendlyDirective); | ||
$friendlyDirective = strtolower((string) $friendlyDirective); |
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.
This is PHP >= 8.1 compatibility fix.
@@ -1774,9 +1773,9 @@ private function longDirective($friendlyDirective) | |||
*/ | |||
private function longSource($friendlySource) | |||
{ | |||
Types::assert(['string' => [$friendlySource]]); | |||
Types::assert(['?string' => [$friendlySource]]); |
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.
This is bug.
|
||
$lowerFriendlySource = strtolower($friendlySource); | ||
$lowerFriendlySource = strtolower((string) $friendlySource); |
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.
This is PHP >= 8.1 compatibility fix.
@@ -7,7 +7,7 @@ | |||
use Aidantwoods\SecureHeaders\Operations\CompileCSP; | |||
use PHPUnit\Framework\TestCase; | |||
|
|||
class CSPTest extends TestCase | |||
class CompileCSPTest extends TestCase |
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.
This is bug in test. PHPUnit was throwing warning.
'Contains', | ||
'NotContains', | ||
'StringContainsString', | ||
'StringNotContainsString', |
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.
This and similar changes is for PHPUnit 10.4.* compatibility
I have added comments in PR to identify the bugs. I am giving description here for bug:
|
I would strongly suggest to split up the unrelated parts of this PR: compatibility changes, CI changes, and especially bug fixes. This drastically increases the chances of getting at least parts merged. |
This pull request does the following:
This pull request is endorsed by ☁️ cebe.cloud