Skip to content

Commit 7bca56c

Browse files
committed
Avoid unneeded empty check, flags return booleans
1 parent ee7fe25 commit 7bca56c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Post_Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,9 @@ public function generate( $args, $assoc_args ) {
713713
$post_author = $user_fetcher->get_check( $post_author )->ID;
714714
}
715715

716-
if ( !empty( \WP_CLI\Utils\get_flag_value( $assoc_args, 'post_content' ) ) ) {
717-
if ( !\WP_CLI\Entity\Utils::has_stdin() ) {
718-
WP_CLI::error( "The parameter `post_content` reads from STDIN." );
716+
if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'post_content' ) ) {
717+
if ( ! \WP_CLI\Entity\Utils::has_stdin() ) {
718+
WP_CLI::error( 'The parameter `post_content` reads from STDIN.' );
719719
}
720720

721721
$post_content = file_get_contents( 'php://stdin' );

0 commit comments

Comments
 (0)