From 9e6d05e2e2d760e5e058b7acfbb4274a73f1efcd Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 25 Mar 2019 14:09:43 +0100 Subject: [PATCH] Actually execute the request --- src/Console/AsmpCommand.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Console/AsmpCommand.php b/src/Console/AsmpCommand.php index f3d8f71..62fd935 100644 --- a/src/Console/AsmpCommand.php +++ b/src/Console/AsmpCommand.php @@ -18,6 +18,7 @@ use ASMP\Client\Model\RollbackRequest; use ASMP\WordPressIntegration\ASMP; use GuzzleHttp\Client; +use Throwable; use WP_CLI; final class AsmpCommand { @@ -43,7 +44,13 @@ public function check( array $args, array $assoc_args ): void { $apiInstance = new CheckApi( new Client(), $this->config ); $body = new CheckRequest(); - var_dump( $body ); + + try { + $response = $apiInstance->check( $body ); + print_r( $response ); + } catch ( Throwable $exception ) { + WP_CLI::error( "Exception when calling CheckApi->change: {$exception->getMessage()}" ); + } } /** @@ -57,7 +64,13 @@ public function change( array $args = [], array $assoc_args = [] ): void { $apiInstance = new ChangeApi( new Client(), $this->config ); $body = new ChangeRequest(); - var_dump( $body ); + + try { + $response = $apiInstance->change( $body ); + print_r( $response ); + } catch ( Throwable $exception ) { + WP_CLI::error( "Exception when calling ChangeApi->change: {$exception->getMessage()}" ); + } } /** @@ -71,7 +84,13 @@ public function rollback( array $args = [], array $assoc_args = [] ): void { $apiInstance = new RollbackApi( new Client(), $this->config ); $body = new RollbackRequest(); - var_dump( $body ); + + try { + $response = $apiInstance->rollback( $body ); + print_r( $response ); + } catch ( Throwable $exception ) { + WP_CLI::error( "Exception when calling RollbackApi->change: {$exception->getMessage()}" ); + } } /**