Skip to content

Commit

Permalink
chore: remove unused imports and cs lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Apr 28, 2023
1 parent cfad002 commit 5cad9f7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
13 changes: 1 addition & 12 deletions src/PhpPact/Standalone/Broker/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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()
Expand Down Expand Up @@ -218,7 +207,7 @@ public function publish(): void
)
);

$runner->runBlocking();
$runner->runBlocking();
}

public function testWebhook()
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpPact/Standalone/Broker/BrokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpPact/Standalone/Runner/ProcessRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 5cad9f7

Please sign in to comment.