@@ -75,19 +75,30 @@ public function handle()
7575 '--add-to-git ' => $ addToGit
7676 ];
7777
78- $ commands = [
79- 'repository:make-entity ' => $ arguments ,
80- 'repository:make-enum ' => array_diff_key ($ arguments , ['--foreign-keys ' => null ]),
81- 'repository:make-factory ' => array_diff_key ($ arguments , ['--foreign-keys ' => null ]),
82- 'repository:make-resource ' => $ arguments ,
83- 'repository:make-interface-repository ' => $ arguments ,
84- 'repository:make-redis-repository ' => $ arguments + ['strategy ' => $ strategy ],
85- 'repository:make-repository ' => $ arguments + ['strategy ' => $ strategy , 'selected_db ' => $ selectedDb ]
86- ];
78+ $ this ->runCommandsWithArguments ($ arguments , $ strategy , $ selectedDb );
79+ }
80+ }
81+
82+ /**
83+ * @param array $arguments
84+ * @param bool|array|string|null $strategy
85+ * @param mixed $selectedDb
86+ * @return void
87+ */
88+ private function runCommandsWithArguments (array $ arguments , bool |array |string |null $ strategy , mixed $ selectedDb ): void
89+ {
90+ $ commands = [
91+ 'repository:make-entity ' => $ arguments ,
92+ 'repository:make-enum ' => array_diff_key ($ arguments , ['--foreign-keys ' => null ]),
93+ 'repository:make-factory ' => array_diff_key ($ arguments , ['--foreign-keys ' => null ]),
94+ 'repository:make-resource ' => $ arguments ,
95+ 'repository:make-interface-repository ' => $ arguments ,
96+ 'repository:make-redis-repository ' => $ arguments + ['strategy ' => $ strategy ],
97+ 'repository:make-repository ' => $ arguments + ['strategy ' => $ strategy , 'selected_db ' => $ selectedDb ]
98+ ];
8799
88- foreach ($ commands as $ command => $ args ) {
89- $ this ->call ($ command , $ args );
90- }
100+ foreach ($ commands as $ command => $ args ) {
101+ $ this ->call ($ command , $ args );
91102 }
92103 }
93104}
0 commit comments