From 5cad9f7ca14236fdaf85fa8a00090c8a5cc5b3d4 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 28 Apr 2023 21:14:46 +0100 Subject: [PATCH] chore: remove unused imports and cs lint fixes --- src/PhpPact/Standalone/Broker/Broker.php | 13 +------------ tests/PhpPact/Standalone/Broker/BrokerTest.php | 2 +- .../PhpPact/Standalone/Runner/ProcessRunnerTest.php | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/PhpPact/Standalone/Broker/Broker.php b/src/PhpPact/Standalone/Broker/Broker.php index eda58eb1..5e9a54e6 100644 --- a/src/PhpPact/Standalone/Broker/Broker.php +++ b/src/PhpPact/Standalone/Broker/Broker.php @@ -2,17 +2,11 @@ namespace PhpPact\Standalone\Broker; -use Amp\ByteStream\ResourceOutputStream; -use Amp\Log\ConsoleFormatter; -use Amp\Log\StreamHandler; -use Monolog\Logger; use PhpPact\Standalone\Installer\Model\Scripts; use PhpPact\Standalone\Runner\ProcessRunner; class Broker { - /** @var Logger */ - private $logger; /** @var BrokerConfig */ private $config; /** @var string */ @@ -22,11 +16,6 @@ public function __construct(BrokerConfig $config) { $this->config = $config; $this->command = Scripts::getBroker(); - $this->logger = (new Logger('console')) - ->pushHandler( - (new StreamHandler(new ResourceOutputStream(\STDOUT))) - ->setFormatter(new ConsoleFormatter(null, null, true)) - ); } public function canIDeploy() @@ -218,7 +207,7 @@ public function publish(): void ) ); - $runner->runBlocking(); + $runner->runBlocking(); } public function testWebhook() diff --git a/tests/PhpPact/Standalone/Broker/BrokerTest.php b/tests/PhpPact/Standalone/Broker/BrokerTest.php index ea1ee6e5..13b67b38 100644 --- a/tests/PhpPact/Standalone/Broker/BrokerTest.php +++ b/tests/PhpPact/Standalone/Broker/BrokerTest.php @@ -91,7 +91,7 @@ public function publishLogsStdError(): void $broker = new Broker($config); try { $broker->publish(); - } catch(\Exception $e){ + } catch(\Exception $e) { $this->assertEquals(1, $e->getCode()); $this->assertStringContainsString("PactPHP Process returned non-zero exit code: 1", $e->getMessage()); } diff --git a/tests/PhpPact/Standalone/Runner/ProcessRunnerTest.php b/tests/PhpPact/Standalone/Runner/ProcessRunnerTest.php index 6e52fab9..ff1b45f4 100644 --- a/tests/PhpPact/Standalone/Runner/ProcessRunnerTest.php +++ b/tests/PhpPact/Standalone/Runner/ProcessRunnerTest.php @@ -67,7 +67,7 @@ public function testProcessRunnerShouldReturnCompleteOutput() } catch (\Exception $e) { $this->assertEquals(42, $e->getCode()); $this->assertStringContainsString("PactPHP Process returned non-zero exit code: 42", $e->getMessage()); - } + } $this->assertTrue((\stripos($p->getOutput(), $expectedOutput) !== false), "Expect '{$expectedOutput}' to be in the output:"); $this->assertTrue((\stripos($p->getStderr(), $expectedErr) !== false), "Expect '{$expectedErr}' to be in the stderr"); }