File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 22
33namespace Differ ;
44
5- use Differ \CommandLineParserInterface as CLP ;
5+ use Differ \CommandLineParserInterface as CLPI ;
66use Differ \FilesDiffCommandInterface as FDCI ;
77use Differ \CommandInterface as CI ;
88use Differ \FormattersInterface as FI ;
99use Differ \DisplayCommandInterface as DCI ;
1010
1111interface CommandFactoryInterface
1212{
13- public function createCommand (string $ commandType ): CLP | FDCI | CI | FI | DCI ;
13+ public function createCommand (string $ commandType ): CLPI | FDCI | CI | FI | DCI ;
1414}
Original file line number Diff line number Diff line change 66use Differ \FilesDiffCommandInterface as FDCI ;
77use Differ \CommandInterface as CI ;
88use Differ \FormattersInterface as FI ;
9+ use Differ \DisplayCommandInterface as DCI ;
910
1011interface CommandInterface
1112{
12- public function execute (CLP |FDCI |CI |FI $ command ): CI |FI ;
13+ public function execute (CLP |FDCI |CI |FI | DCI $ command ): CI |FI ;
1314}
Original file line number Diff line number Diff line change 33namespace Differ ;
44
55use Differ \CommandLineParser ;
6+ use Differ \CommandInterface as CI ;
7+ use Differ \CommandLineParserInterface as CLPI ;
8+ use Differ \FilesDiffCommandInterface as FDCI ;
9+ use Differ \FormattersInterface as FI ;
10+ use Differ \DisplayCommandInterface as DCI ;
611
712class ConsoleApp
813{
9- private CommandInterface |FilesDiffCommandInterface |FormattersInterface |DisplayCommandInterface $ nextCommand ;
14+ private CLPI $ parseCommand ;
15+ private CI |CLPI |FDCI |FI |DCI $ nextCommand ;
1016 private CommandFactoryInterface $ commandFactory ;
17+
18+ /**
19+ * @var array<string> $flowSteps
20+ */
1121 private array $ flowSteps ;
12- private CommandInterface | CommandLineParserInterface | FilesDiffCommandInterface | FormattersInterface | DisplayCommandInterface $ initCommand ;
22+ private CI | CLPI | FDCI | FI | DCI $ initCommand ;
1323
1424 public function __construct (
1525 CommandFactoryInterface $ commandFactory
1626 ) {
1727 $ this ->commandFactory = $ commandFactory ;
1828
19- $ parseCommand = $ this ->commandFactory ->createCommand ("parse " );
20- $ this ->initCommand = $ parseCommand ->execute ($ parseCommand );
29+ $ this -> parseCommand = $ this ->commandFactory ->createCommand ("parse " );
30+ $ this ->initCommand = $ this -> parseCommand ->execute ($ this -> parseCommand );
2131 $ this ->flowSteps = [
2232 "difference " ,
23- strtolower ($ parseCommand ->getFormat ()),
33+ strtolower ($ this -> parseCommand ->getFormat ()),
2434 "show "
2535 ];
2636 }
You can’t perform that action at this time.
0 commit comments