@@ -42,7 +42,9 @@ public function handle()
42
42
'TemporaryCacheStrategy '
43
43
];
44
44
45
- if (in_array ($ this ->option ('strategy_name ' ), $ strategyNames ) === false ) {
45
+ $ strategy = $ this ->option ('strategy_name ' );
46
+
47
+ if ($ strategy !== null && in_array ($ strategy , $ strategyNames ) === false ) {
46
48
$ this ->alert ('This pattern strategy does not exist !!! ' );
47
49
exit ;
48
50
}
@@ -53,7 +55,6 @@ public function handle()
53
55
$ delete = $ this ->option ('delete ' );
54
56
$ detectForeignKeys = $ this ->option ('foreign-keys ' );
55
57
$ addToGit = $ this ->option ('add-to-git ' );
56
- $ strategy = $ this ->option ('strategy_name ' );
57
58
58
59
if ($ this ->option ('all-tables ' )) {
59
60
$ tableNames = $ this ->getAllTableNames ()->pluck ('TABLE_NAME ' );
@@ -93,10 +94,13 @@ private function runCommandsWithArguments(array $arguments, bool|array|string|nu
93
94
'repository:make-resource ' => $ arguments ,
94
95
'repository:make-interface-repository ' => $ arguments ,
95
96
'repository:make-mysql-repository ' => $ arguments ,
96
- 'repository:make-redis-repository ' => $ arguments + ['strategy ' => $ strategy ],
97
97
'repository:make-repository ' => $ arguments + ['strategy ' => $ strategy , 'selected_db ' => $ selectedDb ]
98
98
];
99
99
100
+ if ($ strategy !== null ) {
101
+ $ commands ['repository:make-redis-repository ' ] = $ arguments + ['strategy ' => $ strategy ];
102
+ }
103
+
100
104
foreach ($ commands as $ command => $ args ) {
101
105
$ this ->call ($ command , $ args );
102
106
}
0 commit comments