Skip to content

Commit f7d5d74

Browse files
committed
update formatters
1 parent ca7e807 commit f7d5d74

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ validate:
88
composer validate
99

1010
analyze:
11-
./vendor/bin/phpstan analyze --level 3 src tests
11+
./vendor/bin/phpstan analyze --level 3 src/ tests/
1212

1313
lint:
14-
composer exec --verbose phpcs -- --standard=PSR12 src bin
14+
composer exec --verbose phpcs -- --standard=PSR12 src/ bin/
1515

1616
test:
1717
XDEBUG_MODE=coverage composer exec --verbose vendor/bin/phpunit tests -- --coverage-text

src/Formatters.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ class Formatters implements CommandFactoryInterface
1717

1818
public function createCommand(string $commandKey): CommandInterface
1919
{
20+
$requestedCommand = null;
2021
switch ($commandKey) {
2122
case self::FORMAT_KEYS["stylish"]:
22-
return new StylishCommand();
23+
$requestedCommand = new StylishCommand();
24+
break;
2325
case self::FORMAT_KEYS["plain"]:
24-
return new PlainCommand();
26+
$requestedCommand = new PlainCommand();
27+
break;
2528
case self::FORMAT_KEYS["json"]:
26-
return new JSONCommand();
29+
$requestedCommand = new JSONCommand();
30+
break;
2731
default:
2832
return throw new DifferException("input error: unknown output format\n");
2933
}
34+
35+
return $requestedCommand;
3036
}
3137
}

0 commit comments

Comments
 (0)