Skip to content

Commit ef65d35

Browse files
committed
Fix PHPCS issues
1 parent 8b16bbc commit ef65d35

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<exclude-pattern>*/src/Post(_Meta|_Term|_Type)?_Command\.php$</exclude-pattern>
6868
<exclude-pattern>*/src/Site(_Meta|_Option)?_Command\.php$</exclude-pattern>
6969
<exclude-pattern>*/src/Term(_Meta)?_Command\.php$</exclude-pattern>
70-
<exclude-pattern>*/src/User(_Meta|_Session|_Term)?_Command\.php$</exclude-pattern>
70+
<exclude-pattern>*/src/User(_Application_Password|_Meta|_Session|_Term)?_Command\.php$</exclude-pattern>
7171
</rule>
7272

7373
<!-- Whitelisting to provide backward compatibility to classes possibly extending this class. -->

src/User_Application_Password_Command.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ public function delete( $args, $assoc_args ) {
404404

405405
$user_id = array_shift( $args );
406406
$all = Utils\get_flag_value( $assoc_args, 'all', false );
407-
$count = count($args);
407+
$count = count( $args );
408408

409-
if ( ( $count > 0 && true === $all ) || ( $count === 0 && true !== $all ) ) {
409+
if ( ( 0 < $count && true === $all ) || ( 0 === $count && true !== $all ) ) {
410410
WP_CLI::error( 'You need to specify either one or more UUIDS or provide the --all flag' );
411411
}
412412

@@ -439,7 +439,7 @@ public function delete( $args, $assoc_args ) {
439439
)
440440
);
441441

442-
WP_CLI::halt( $errors === 0 ? 0 : 1 );
442+
WP_CLI::halt( 0 === $errors ? 0 : 1 );
443443
}
444444

445445
/**
@@ -507,8 +507,7 @@ private function replace_login_with_user_id( $args ) {
507507
* @param string $app_name Application name to look for.
508508
* @return bool
509509
*/
510-
private function application_name_exists_for_user( $user_id, $app_name )
511-
{
510+
private function application_name_exists_for_user( $user_id, $app_name ) {
512511
if ( Utils\wp_version_compare( '5.7', '<' ) ) {
513512
$passwords = WP_Application_Passwords::get_user_application_passwords( $user_id );
514513

0 commit comments

Comments
 (0)