@@ -27,11 +27,7 @@ trait GeneratorTrait
2727
2828 // all generated entities/resources
2929 private $ forms ;
30- private $ mappers ;
3130 private $ routes ;
32- private $ migrations ;
33- private $ controllers ;
34- private $ tests ;
3531
3632 // gen dir found in history
3733 private $ genDir ;
@@ -64,8 +60,8 @@ private function generateResources(): void
6460 $ this ->error ($ e ->getTraceAsString ());
6561 }
6662
67- $ this -> tests = new Tests ($ this );
68- $ this -> tests ->createEntity ($ this ->formatFuncTestsPath (), DefaultInterface::FUNCTIONAL_POSTFIX );
63+ $ tests = new Tests ($ this );
64+ $ tests ->createEntity ($ this ->formatFuncTestsPath (), DefaultInterface::FUNCTIONAL_POSTFIX );
6965 }
7066
7167 $ this ->createMigrations ();
@@ -95,17 +91,17 @@ private function mergeResources(): void
9591 */
9692 private function solveControllers (): void
9793 {
98- $ this -> controllers = new Controllers ($ this );
94+ $ controllers = new Controllers ($ this );
9995 $ controllerPath = $ this ->formatControllersPath ();
10096
10197 if (empty ($ this ->options [ConsoleInterface::OPTION_REGENERATE ]) === false
102- && file_exists ($ this -> controllers ->getEntityFile ($ controllerPath ,
98+ && file_exists ($ controllers ->getEntityFile ($ controllerPath ,
10399 DefaultInterface::CONTROLLER_POSTFIX )) === true ) {
104100
105- $ this -> controllers ->recreateEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
101+ $ controllers ->recreateEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
106102 } else {
107- $ this -> controllers ->createDefault ();
108- $ this -> controllers ->createEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
103+ $ controllers ->createDefault ();
104+ $ controllers ->createEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
109105 }
110106 }
111107
@@ -129,15 +125,15 @@ private function solveFormRequest(): void
129125 private function solveEntities (): void
130126 {
131127 // create entities/models
132- $ this -> mappers = new Entities ($ this );
133- $ this -> mappers ->createPivot ();
128+ $ mappers = new Entities ($ this );
129+ $ mappers ->createPivot ();
134130 $ entitiesPath = $ this ->formatEntitiesPath ();
135131
136132 if (empty ($ this ->options [ConsoleInterface::OPTION_MERGE ]) === false
137133 && file_exists ($ this ->forms ->getEntityFile ($ entitiesPath )) === true ) {
138- $ this -> mappers ->recreateEntity ($ entitiesPath );
134+ $ mappers ->recreateEntity ($ entitiesPath );
139135 } else {
140- $ this -> mappers ->createEntity ($ entitiesPath );
136+ $ mappers ->createEntity ($ entitiesPath );
141137 }
142138 }
143139
@@ -155,9 +151,9 @@ private function outputEntity(): void
155151 private function createMigrations (): void
156152 {
157153 if (empty ($ this ->options [ConsoleInterface::OPTION_MIGRATIONS ]) === false ) {
158- $ this -> migrations = new Migrations ($ this );
159- $ this -> migrations ->create ();
160- $ this -> migrations ->createPivot ();
154+ $ migrations = new Migrations ($ this );
155+ $ migrations ->create ();
156+ $ migrations ->createPivot ();
161157 }
162158 }
163159}
0 commit comments