File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ class CommandFactory implements CommandFactoryInterface
1111 private mixed $ parser ;
1212 private FileReaderInterface $ fileReader ;
1313 private const array FORMAT_KEYS = [
14- "stylish " , "plain " , "json "
14+ "stylish " => "stylish " ,
15+ "plain " => "plain " ,
16+ "json " => "json "
1517 ];
1618
1719 public function __construct (
@@ -37,13 +39,13 @@ public function getCommand(string $commandType): ?CommandInterface
3739 $ requestedCommand = (new FilesDiffCommand ())
3840 ->setFileReader ($ this ->fileReader );
3941 break ;
40- case self ::FORMAT_KEYS [0 ]:
42+ case self ::FORMAT_KEYS [" stylish " ]:
4143 $ requestedCommand = new StylishCommand ();
4244 break ;
43- case self ::FORMAT_KEYS [1 ]:
45+ case self ::FORMAT_KEYS [" plain " ]:
4446 $ requestedCommand = new PlainCommand ();
4547 break ;
46- case self ::FORMAT_KEYS [2 ]:
48+ case self ::FORMAT_KEYS [" json " ]:
4749 $ requestedCommand = new JSONCommand ();
4850 break ;
4951 case "format " :
You can’t perform that action at this time.
0 commit comments