@@ -27,11 +27,7 @@ trait GeneratorTrait
27
27
28
28
// all generated entities/resources
29
29
private $ forms ;
30
- private $ mappers ;
31
30
private $ routes ;
32
- private $ migrations ;
33
- private $ controllers ;
34
- private $ tests ;
35
31
36
32
// gen dir found in history
37
33
private $ genDir ;
@@ -64,8 +60,8 @@ private function generateResources(): void
64
60
$ this ->error ($ e ->getTraceAsString ());
65
61
}
66
62
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 );
69
65
}
70
66
71
67
$ this ->createMigrations ();
@@ -95,17 +91,17 @@ private function mergeResources(): void
95
91
*/
96
92
private function solveControllers (): void
97
93
{
98
- $ this -> controllers = new Controllers ($ this );
94
+ $ controllers = new Controllers ($ this );
99
95
$ controllerPath = $ this ->formatControllersPath ();
100
96
101
97
if (empty ($ this ->options [ConsoleInterface::OPTION_REGENERATE ]) === false
102
- && file_exists ($ this -> controllers ->getEntityFile ($ controllerPath ,
98
+ && file_exists ($ controllers ->getEntityFile ($ controllerPath ,
103
99
DefaultInterface::CONTROLLER_POSTFIX )) === true ) {
104
100
105
- $ this -> controllers ->recreateEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
101
+ $ controllers ->recreateEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
106
102
} else {
107
- $ this -> controllers ->createDefault ();
108
- $ this -> controllers ->createEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
103
+ $ controllers ->createDefault ();
104
+ $ controllers ->createEntity ($ controllerPath , DefaultInterface::CONTROLLER_POSTFIX );
109
105
}
110
106
}
111
107
@@ -129,15 +125,15 @@ private function solveFormRequest(): void
129
125
private function solveEntities (): void
130
126
{
131
127
// create entities/models
132
- $ this -> mappers = new Entities ($ this );
133
- $ this -> mappers ->createPivot ();
128
+ $ mappers = new Entities ($ this );
129
+ $ mappers ->createPivot ();
134
130
$ entitiesPath = $ this ->formatEntitiesPath ();
135
131
136
132
if (empty ($ this ->options [ConsoleInterface::OPTION_MERGE ]) === false
137
133
&& file_exists ($ this ->forms ->getEntityFile ($ entitiesPath )) === true ) {
138
- $ this -> mappers ->recreateEntity ($ entitiesPath );
134
+ $ mappers ->recreateEntity ($ entitiesPath );
139
135
} else {
140
- $ this -> mappers ->createEntity ($ entitiesPath );
136
+ $ mappers ->createEntity ($ entitiesPath );
141
137
}
142
138
}
143
139
@@ -155,9 +151,9 @@ private function outputEntity(): void
155
151
private function createMigrations (): void
156
152
{
157
153
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 ();
161
157
}
162
158
}
163
159
}
0 commit comments