-
Notifications
You must be signed in to change notification settings - Fork 292
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
Bug/#5110 fix php81 warnings #5968
Changes from 10 commits
1ec76fd
e8f99a9
36f7040
fc51d2a
0252423
0533f2b
6930f15
575cc70
0493f60
d6d889b
9197ff7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -121,7 +121,9 @@ public function __isset( $name ) { | |||||
* | ||||||
* @return bool | ||||||
*/ | ||||||
public function offsetExists( $key ) { | ||||||
// phpcs:ignore Squiz.Commenting.InlineComment.WrongStyle,Squiz.PHP.CommentedOutCode.Found | ||||||
#[\ReturnTypeWillChange] | ||||||
public function offsetExists( $key ) { // phpcs:ignore Squiz.Commenting.FunctionComment.WrongStyle | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I run Loosening up the rule definition allows linting to pass in PHP 8 as well as older versions.
Suggested change
|
||||||
return array_key_exists( $key, $this->data ); | ||||||
} | ||||||
|
||||||
|
@@ -132,7 +134,9 @@ public function offsetExists( $key ) { | |||||
* | ||||||
* @return mixed | ||||||
*/ | ||||||
public function offsetGet( $key ) { | ||||||
// phpcs:ignore Squiz.Commenting.InlineComment.WrongStyle,Squiz.PHP.CommentedOutCode.Found | ||||||
#[\ReturnTypeWillChange] | ||||||
public function offsetGet( $key ) { // phpcs:ignore Squiz.Commenting.FunctionComment.WrongStyle | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above
Suggested change
|
||||||
if ( $this->offsetExists( $key ) ) { | ||||||
return $this->data[ $key ]; | ||||||
} | ||||||
|
@@ -146,7 +150,9 @@ public function offsetGet( $key ) { | |||||
* @param string|int $key Key to set the value for. | ||||||
* @param mixed $value New value for the given key. | ||||||
*/ | ||||||
public function offsetSet( $key, $value ) { | ||||||
// phpcs:ignore Squiz.Commenting.InlineComment.WrongStyle,Squiz.PHP.CommentedOutCode.Found | ||||||
#[\ReturnTypeWillChange] | ||||||
public function offsetSet( $key, $value ) { // phpcs:ignore Squiz.Commenting.FunctionComment.WrongStyle | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above
Suggested change
|
||||||
// Data is immutable. | ||||||
} | ||||||
|
||||||
|
@@ -155,7 +161,9 @@ public function offsetSet( $key, $value ) { | |||||
* | ||||||
* @param string|int $key Key to unset. | ||||||
*/ | ||||||
public function offsetUnset( $key ) { | ||||||
// phpcs:ignore Squiz.Commenting.InlineComment.WrongStyle,Squiz.PHP.CommentedOutCode.Found | ||||||
#[\ReturnTypeWillChange] | ||||||
public function offsetUnset( $key ) { // phpcs:ignore Squiz.Commenting.FunctionComment.WrongStyle | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above
Suggested change
|
||||||
// Data is immutable. | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -71,7 +71,7 @@ public function test_filter_input() { | |||||||||
$this->assertTrue( $context->input()->filter( INPUT_GET, 'foo', FILTER_VALIDATE_BOOLEAN ) ); | ||||||||||
|
||||||||||
$_GET['dirty'] = '<script>dirt</script>'; | ||||||||||
$this->assertEquals( 'dirt', $context->input()->filter( INPUT_GET, 'dirty', FILTER_SANITIZE_STRING ) ); | ||||||||||
$this->assertEquals( '<script>dirt</script>', htmlspecialchars( $context->input()->filter( INPUT_GET, 'dirty' ) ) ); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test doesn't seem so useful now as it's effectively just testing the standard
Suggested change
|
||||||||||
} | ||||||||||
|
||||||||||
public function test_admin_url() { | ||||||||||
|
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.
Nice!