mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50. Includes minor code layout fixes for better readability. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47550 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -502,7 +502,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
* @return mixed Property.
|
||||
*/
|
||||
public function __get( $name ) {
|
||||
if ( in_array( $name, $this->compat_fields ) ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return $this->$name;
|
||||
}
|
||||
}
|
||||
@@ -517,7 +517,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
* @return mixed Newly-set property.
|
||||
*/
|
||||
public function __set( $name, $value ) {
|
||||
if ( in_array( $name, $this->compat_fields ) ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return $this->$name = $value;
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
* @return bool Whether the property is set.
|
||||
*/
|
||||
public function __isset( $name ) {
|
||||
if ( in_array( $name, $this->compat_fields ) ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
}
|
||||
@@ -544,7 +544,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
* @param string $name Property to unset.
|
||||
*/
|
||||
public function __unset( $name ) {
|
||||
if ( in_array( $name, $this->compat_fields ) ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
unset( $this->$name );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user