Skip to content

Commit 3403a53

Browse files
committed
Avoid PHP-4 comparison functions
1 parent 5f2d680 commit 3403a53

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Option_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public function update( $args, $assoc_args ) {
423423
}
424424
$old_value = sanitize_option( $key, get_option( $key ) );
425425

426-
if ( $value === $old_value && is_null( $autoload ) ) {
426+
if ( $value === $old_value && null === $autoload ) {
427427
WP_CLI::success( "Value passed for '{$key}' option is unchanged." );
428428
} else {
429429
if ( update_option( $key, $value, $autoload ) ) {

src/Term_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function update( $args, $assoc_args ) {
358358
$assoc_args = wp_parse_args( $assoc_args, $defaults );
359359

360360
foreach ( $assoc_args as $key => $value ) {
361-
if ( is_null( $value ) ) {
361+
if ( null === $value ) {
362362
unset( $assoc_args[ $key ] );
363363
}
364364
}

src/User_Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ public function import_csv( $args, $assoc_args ) {
963963
$roles = array_map( 'trim', explode( ',', $new_user['roles'] ) );
964964
$invalid_role = false;
965965
foreach ( $roles as $role ) {
966-
if ( is_null( get_role( $role ) ) ) {
966+
if ( null === get_role( $role ) ) {
967967
WP_CLI::warning( "{$new_user['user_login']} has an invalid role." );
968968
$invalid_role = true;
969969
break;
@@ -976,7 +976,7 @@ public function import_csv( $args, $assoc_args ) {
976976
$secondary_roles = $roles;
977977
} elseif ( 'none' === $new_user['role'] ) {
978978
$new_user['role'] = false;
979-
} elseif ( is_null( get_role( $new_user['role'] ) ) ) {
979+
} elseif ( null === get_role( $new_user['role'] ) ) {
980980
WP_CLI::warning( "{$new_user['user_login']} has an invalid role." );
981981
continue;
982982
}
@@ -1105,7 +1105,7 @@ public function reset_password( $args, $assoc_args ) {
11051105
*/
11061106
private static function validate_role( $role ) {
11071107

1108-
if ( ! empty( $role ) && is_null( get_role( $role ) ) ) {
1108+
if ( ! empty( $role ) && null === get_role( $role ) ) {
11091109
WP_CLI::error( sprintf( "Role doesn't exist: %s", $role ) );
11101110
}
11111111

src/WP_CLI/Fetchers/Comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function get( $arg ) {
2222
$comment_id = (int) $arg;
2323
$comment = get_comment( $comment_id );
2424

25-
if ( is_null( $comment ) ) {
25+
if ( null === $comment ) {
2626
return false;
2727
}
2828

0 commit comments

Comments
 (0)