From 7247de0ad959e54f96ae8514d9b20560636213d1 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 6 May 2024 10:34:44 +0200 Subject: [PATCH] Fix "Unreachable statement - code above always terminates.". https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-error/ --- src/CLI.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/CLI.php b/src/CLI.php index f27f2de..c68bb4d 100644 --- a/src/CLI.php +++ b/src/CLI.php @@ -295,8 +295,6 @@ public function wp_cli_payments( $args, $assoc_args ) { if ( empty( $api_key ) ) { \WP_CLI::error( 'This command requires an API key for authentication' ); - - return; } $client = new Client( $api_key ); @@ -403,14 +401,10 @@ public function wp_cli_payments_cancel( $args, $assoc_args ) { if ( empty( $api_key ) ) { \WP_CLI::error( 'This command requires an API key for authentication' ); - - return; } if ( empty( $args ) ) { \WP_CLI::error( 'This command requires a transaction ID to cancel payments' ); - - return; } $client = new Client( $api_key );