18
18
use InfyOm \Generator \Generators \Scaffold \RequestGenerator ;
19
19
use InfyOm \Generator \Generators \Scaffold \RoutesGenerator ;
20
20
use InfyOm \Generator \Generators \Scaffold \ViewGenerator ;
21
+ use InfyOm \Generator \Utils \FileUtil ;
21
22
use Symfony \Component \Console \Input \InputArgument ;
22
23
use Symfony \Component \Console \Input \InputOption ;
23
24
@@ -64,7 +65,8 @@ public function __construct()
64
65
*/
65
66
public function handle ()
66
67
{
67
- if (!in_array ($ this ->argument ('type ' ), [
68
+ $ type = $ this ->argument ('type ' );
69
+ if (!in_array ($ type , [
68
70
CommandData::$ COMMAND_TYPE_API ,
69
71
CommandData::$ COMMAND_TYPE_SCAFFOLD ,
70
72
CommandData::$ COMMAND_TYPE_API_SCAFFOLD ,
@@ -73,6 +75,7 @@ public function handle()
73
75
}
74
76
75
77
$ this ->commandData = new CommandData ($ this , $ this ->argument ('type ' ));
78
+ $ this ->commandData ->fireEvent ($ type , FileUtil::FILE_DELETING );
76
79
$ this ->commandData ->config ->mName = $ this ->commandData ->modelName = $ this ->argument ('model ' );
77
80
78
81
$ this ->commandData ->config ->init ($ this ->commandData , ['tableName ' , 'prefix ' , 'plural ' , 'views ' ]);
@@ -85,6 +88,7 @@ public function handle()
85
88
86
89
$ this ->info ('Generating autoload files ' );
87
90
$ this ->composer ->dumpOptimized ();
91
+ $ this ->commandData ->fireEvent ($ type , FileUtil::FILE_DELETED );
88
92
89
93
return ;
90
94
}
@@ -137,6 +141,8 @@ public function handle()
137
141
138
142
$ this ->info ('Generating autoload files ' );
139
143
$ this ->composer ->dumpOptimized ();
144
+
145
+ $ this ->commandData ->fireEvent ($ type , FileUtil::FILE_DELETED );
140
146
}
141
147
142
148
/**
0 commit comments