1818use InfyOm \Generator \Generators \Scaffold \RequestGenerator ;
1919use InfyOm \Generator \Generators \Scaffold \RoutesGenerator ;
2020use InfyOm \Generator \Generators \Scaffold \ViewGenerator ;
21+ use InfyOm \Generator \Utils \FileUtil ;
2122use Symfony \Component \Console \Input \InputArgument ;
2223use Symfony \Component \Console \Input \InputOption ;
2324
@@ -64,7 +65,8 @@ public function __construct()
6465 */
6566 public function handle ()
6667 {
67- if (!in_array ($ this ->argument ('type ' ), [
68+ $ type = $ this ->argument ('type ' );
69+ if (!in_array ($ type , [
6870 CommandData::$ COMMAND_TYPE_API ,
6971 CommandData::$ COMMAND_TYPE_SCAFFOLD ,
7072 CommandData::$ COMMAND_TYPE_API_SCAFFOLD ,
@@ -73,6 +75,7 @@ public function handle()
7375 }
7476
7577 $ this ->commandData = new CommandData ($ this , $ this ->argument ('type ' ));
78+ $ this ->commandData ->fireEvent ($ type , FileUtil::FILE_DELETING );
7679 $ this ->commandData ->config ->mName = $ this ->commandData ->modelName = $ this ->argument ('model ' );
7780
7881 $ this ->commandData ->config ->init ($ this ->commandData , ['tableName ' , 'prefix ' , 'plural ' , 'views ' ]);
@@ -85,6 +88,7 @@ public function handle()
8588
8689 $ this ->info ('Generating autoload files ' );
8790 $ this ->composer ->dumpOptimized ();
91+ $ this ->commandData ->fireEvent ($ type , FileUtil::FILE_DELETED );
8892
8993 return ;
9094 }
@@ -137,6 +141,8 @@ public function handle()
137141
138142 $ this ->info ('Generating autoload files ' );
139143 $ this ->composer ->dumpOptimized ();
144+
145+ $ this ->commandData ->fireEvent ($ type , FileUtil::FILE_DELETED );
140146 }
141147
142148 /**
0 commit comments