Skip to content

Commit

Permalink
correct validation boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Sep 13, 2024
1 parent 92a3b76 commit 98b127b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wp-cli/class-theme-check-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ public function run( $args, $assoc_args ) {

// The validation value is a boolean, but if the format is not JSON, we want to return a string.
$validation_value = $format === 'json'
? false
? $success
: "There are no required changes in the theme {$check_theme_slug}.";

if ( ! $success ) {
$validation_value =

Check failure on line 71 in wp-cli/class-theme-check-cli.php

View workflow job for this annotation

GitHub Actions / PHP Code Standards

Whitespace found at end of line
// If the format is JSON, return false, otherwise return a message
$format === 'json'
? true
? $success
: "There are required changes in the theme {$check_theme_slug}.";
}

Expand All @@ -81,7 +81,7 @@ public function run( $args, $assoc_args ) {
);

WP_CLI\Utils\format_items( $format, $processed_messages, array( 'type', 'value' ) );

// Set the exit code based on $success
WP_CLI::halt( $success ? 0 : 1 );
}
Expand Down

0 comments on commit 98b127b

Please sign in to comment.