Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstuck committed Aug 11, 2016
1 parent 16dd258 commit 1e35b94
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Formatter/ClassNameFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ class ClassNameFormatter implements Formatter
* @param string $commandSucceededLevel
* @param string $commandFailedLevel
*/
public function __construct($commandReceivedLevel = LogLevel::DEBUG, $commandSucceededLevel = LogLevel::DEBUG, $commandFailedLevel = LogLevel::ERROR)
{
public function __construct(
$commandReceivedLevel = LogLevel::DEBUG,
$commandSucceededLevel = LogLevel::DEBUG,
$commandFailedLevel = LogLevel::ERROR
) {
$this->commandReceivedLevel = $commandReceivedLevel;
$this->commandSucceededLevel = $commandSucceededLevel;
$this->commandFailedLevel = $commandFailedLevel;
Expand Down
3 changes: 2 additions & 1 deletion src/LoggerMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class LoggerMiddleware implements Middleware
* @param Formatter $formatter
* @param LoggerInterface $logger
*/
public function __construct(Formatter $formatter, LoggerInterface $logger) {
public function __construct(Formatter $formatter, LoggerInterface $logger)
{
$this->formatter = $formatter;
$this->logger = $logger;
}
Expand Down
7 changes: 6 additions & 1 deletion tests/Formatter/ClassPropertiesFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ public function testCommandFailedCreatesExpectedMessage()

public function testCustomLogLevels()
{
$formatter = new ClassPropertiesFormatter($this->normalizer, LogLevel::WARNING, LogLevel::NOTICE, LogLevel::EMERGENCY);
$formatter = new ClassPropertiesFormatter(
$this->normalizer,
LogLevel::WARNING,
LogLevel::NOTICE,
LogLevel::EMERGENCY
);

$this->logger->shouldReceive('log')->with(LogLevel::WARNING, Mockery::any(), Mockery::any())->once();
$formatter->logCommandReceived($this->logger, new RegisterUserCommand());
Expand Down
7 changes: 6 additions & 1 deletion tests/LoggerMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ public function testEmptyReturnValuesIsPassedAsNull()
$this->formatter->shouldReceive('logCommandReceived')->with($this->logger, $command)->once();
$this->formatter->shouldReceive('logCommandSucceeded')->with($this->logger, $command, null)->once();

$this->middleware->execute($command, function () {});
$this->middleware->execute(
$command,
function () {
// no-op
}
);
}

/**
Expand Down

0 comments on commit 1e35b94

Please sign in to comment.