@@ -169,7 +169,7 @@ |
||
169 | 169 | |
170 | 170 | if (file_exists(app_path('JsonApi'))) { |
171 | 171 | if(!@rmdir(app_path('JsonApi'))) { |
172 | - throw new \League\Flysystem\Exception('JsonApi directory is not empty!'); |
|
172 | + throw new \League\Flysystem\Exception('JsonApi directory is not empty!'); |
|
173 | 173 | }; |
174 | 174 | } |
175 | 175 | } catch (\League\Flysystem\Exception $e) { |
@@ -122,19 +122,19 @@ discard block |
||
122 | 122 | protected function setupTest() |
123 | 123 | { |
124 | 124 | foreach ($this->migrations as $key => $value) { |
125 | - $this->migrations[$key] = $value . $this->testPostfix; |
|
125 | + $this->migrations[ $key ] = $value . $this->testPostfix; |
|
126 | 126 | } |
127 | 127 | foreach ($this->seeds as $key => $value) { |
128 | - $this->seeds[$key] = $value . $this->testPostfix; |
|
128 | + $this->seeds[ $key ] = $value . $this->testPostfix; |
|
129 | 129 | } |
130 | 130 | foreach ($this->controllers as $key => $value) { |
131 | - $this->controllers[$key] = $value . $this->testPostfix; |
|
131 | + $this->controllers[ $key ] = $value . $this->testPostfix; |
|
132 | 132 | } |
133 | 133 | foreach ($this->models as $key => $value) { |
134 | - $this->models[$key] = $value . $this->testPostfix; |
|
134 | + $this->models[ $key ] = $value . $this->testPostfix; |
|
135 | 135 | } |
136 | 136 | foreach ($this->jsonapiEntities as $key => $value) { |
137 | - $this->jsonapiEntities[$key] = $value . $this->testPostfix; |
|
137 | + $this->jsonapiEntities[ $key ] = $value . $this->testPostfix; |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | { |
170 | 170 | foreach ($this->migrations as $key => $value) { |
171 | 171 | $mask = database_path('migrations/*' . $value); |
172 | - array_map( "unlink", glob( $mask ) ); |
|
172 | + array_map("unlink", glob($mask)); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | if (file_exists(app_path('JsonApi'))) { |
216 | - if(!@rmdir(app_path('JsonApi'))) { |
|
216 | + if (!@rmdir(app_path('JsonApi'))) { |
|
217 | 217 | throw new \League\Flysystem\Exception('JsonApi directory is not empty!'); |
218 | 218 | }; |
219 | 219 | } |
@@ -4,9 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use org\bovigo\vfs\vfsStream; |
7 | -use Symfony\Component\Console\Input\InputInterface; |
|
8 | -use Symfony\Component\Console\Output\OutputInterface; |
|
9 | - |
|
10 | 7 | use org\bovigo\vfs\vfsStreamDirectory; |
11 | 8 | use org\bovigo\vfs\vfsStreamWrapper; |
12 | 9 |
@@ -131,19 +131,19 @@ discard block |
||
131 | 131 | protected function setupTest() |
132 | 132 | { |
133 | 133 | foreach ($this->migrations as $key => $value) { |
134 | - $this->migrations[$key] = $value . $this->testPostfix; |
|
134 | + $this->migrations[ $key ] = $value . $this->testPostfix; |
|
135 | 135 | } |
136 | 136 | foreach ($this->seeds as $key => $value) { |
137 | - $this->seeds[$key] = $value . $this->testPostfix; |
|
137 | + $this->seeds[ $key ] = $value . $this->testPostfix; |
|
138 | 138 | } |
139 | 139 | foreach ($this->controllers as $key => $value) { |
140 | - $this->controllers[$key] = $value . $this->testPostfix; |
|
140 | + $this->controllers[ $key ] = $value . $this->testPostfix; |
|
141 | 141 | } |
142 | 142 | foreach ($this->models as $key => $value) { |
143 | - $this->models[$key] = $value . $this->testPostfix; |
|
143 | + $this->models[ $key ] = $value . $this->testPostfix; |
|
144 | 144 | } |
145 | 145 | foreach ($this->jsonapiEntities as $key => $value) { |
146 | - $this->jsonapiEntities[$key] = $value . $this->testPostfix; |
|
146 | + $this->jsonapiEntities[ $key ] = $value . $this->testPostfix; |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | protected function copyJsonApiEntities() |
199 | 199 | { |
200 | 200 | foreach ($this->jsonapiEntities as $key => $value) { |
201 | - if (file_exists(app_path('JsonApi/'.$value)) && ! $this->option('force')) { |
|
202 | - if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) { |
|
201 | + if (file_exists(app_path('JsonApi/' . $value)) && !$this->option('force')) { |
|
202 | + if (!$this->confirm("The [{$value}] already exists. Do you want to replace it?")) { |
|
203 | 203 | continue; |
204 | 204 | } |
205 | 205 | } |
206 | 206 | |
207 | 207 | copy( |
208 | - base_path('stubs/'.$key), |
|
208 | + base_path('stubs/' . $key), |
|
209 | 209 | app_path($value) |
210 | 210 | ); |
211 | 211 | } |
@@ -227,22 +227,22 @@ discard block |
||
227 | 227 | protected function exportControllers() |
228 | 228 | { |
229 | 229 | if ($this->option('fake')) { |
230 | - $path = $this->stubs['controllers']; |
|
230 | + $path = $this->stubs[ 'controllers' ]; |
|
231 | 231 | $baseDir = new vfsStreamDirectory('app'); |
232 | 232 | vfsStream::copyFromFileSystem($path, $baseDir); |
233 | 233 | return true; |
234 | 234 | } |
235 | 235 | |
236 | 236 | foreach ($this->controllers as $key => $value) { |
237 | - if (file_exists(app_path('Http/Controllers/Api/v1/'.$value)) && ! $this->option('force')) { |
|
238 | - if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) { |
|
237 | + if (file_exists(app_path('Http/Controllers/Api/v1/' . $value)) && !$this->option('force')) { |
|
238 | + if (!$this->confirm("The [{$value}] already exists. Do you want to replace it?")) { |
|
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | 243 | copy( |
244 | - base_path('stubs/Controllers/'.$key), |
|
245 | - app_path('Http/Controllers/Api/v1/'.$value) |
|
244 | + base_path('stubs/Controllers/' . $key), |
|
245 | + app_path('Http/Controllers/Api/v1/' . $value) |
|
246 | 246 | ); |
247 | 247 | } |
248 | 248 | } |
@@ -253,22 +253,22 @@ discard block |
||
253 | 253 | protected function exportModels() |
254 | 254 | { |
255 | 255 | if ($this->option('fake')) { |
256 | - $path = $this->stubs['models']; |
|
256 | + $path = $this->stubs[ 'models' ]; |
|
257 | 257 | $baseDir = new vfsStreamDirectory('app'); |
258 | 258 | vfsStream::copyFromFileSystem($path, $baseDir); |
259 | 259 | return true; |
260 | 260 | } |
261 | 261 | |
262 | 262 | foreach ($this->models as $key => $value) { |
263 | - if (file_exists(app_path('Models/'.$value)) && ! $this->option('force')) { |
|
264 | - if (! $this->confirm("The [{$value}] model already exists. Do you want to replace it?")) { |
|
263 | + if (file_exists(app_path('Models/' . $value)) && !$this->option('force')) { |
|
264 | + if (!$this->confirm("The [{$value}] model already exists. Do you want to replace it?")) { |
|
265 | 265 | continue; |
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | 269 | copy( |
270 | - base_path('stubs/Models/'.$key), |
|
271 | - app_path('Models/'.$value) |
|
270 | + base_path('stubs/Models/' . $key), |
|
271 | + app_path('Models/' . $value) |
|
272 | 272 | ); |
273 | 273 | } |
274 | 274 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | protected function exportMigrations() |
280 | 280 | { |
281 | 281 | if ($this->option('fake')) { |
282 | - $path = $this->stubs['migrations']; |
|
282 | + $path = $this->stubs[ 'migrations' ]; |
|
283 | 283 | $baseDir = new vfsStreamDirectory('app'); |
284 | 284 | vfsStream::copyFromFileSystem($path, $baseDir); |
285 | 285 | return true; |
@@ -287,15 +287,15 @@ discard block |
||
287 | 287 | |
288 | 288 | $counter = 0; |
289 | 289 | foreach ($this->migrations as $key => $value) { |
290 | - if (file_exists(database_path('migrations/'.$value)) && ! $this->option('force')) { |
|
291 | - if (! $this->confirm("The [{$value}] migration already exists. Do you want to replace it?")) { |
|
290 | + if (file_exists(database_path('migrations/' . $value)) && !$this->option('force')) { |
|
291 | + if (!$this->confirm("The [{$value}] migration already exists. Do you want to replace it?")) { |
|
292 | 292 | continue; |
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
296 | 296 | copy( |
297 | 297 | base_path('stubs/migrations/' . $key), |
298 | - database_path('migrations/'. date('Y_m_d_Hi') . '0' . $counter++ . '_' . $value) |
|
298 | + database_path('migrations/' . date('Y_m_d_Hi') . '0' . $counter++ . '_' . $value) |
|
299 | 299 | ); |
300 | 300 | } |
301 | 301 | } |
@@ -306,22 +306,22 @@ discard block |
||
306 | 306 | protected function exportSeeds() |
307 | 307 | { |
308 | 308 | if ($this->option('fake')) { |
309 | - $path = $this->stubs['seeds']; |
|
309 | + $path = $this->stubs[ 'seeds' ]; |
|
310 | 310 | $baseDir = new vfsStreamDirectory('app'); |
311 | 311 | vfsStream::copyFromFileSystem($path, $baseDir); |
312 | 312 | return true; |
313 | 313 | } |
314 | 314 | |
315 | 315 | foreach ($this->seeds as $key => $value) { |
316 | - if (file_exists(database_path('seeds/'.$value)) && ! $this->option('force')) { |
|
317 | - if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) { |
|
316 | + if (file_exists(database_path('seeds/' . $value)) && !$this->option('force')) { |
|
317 | + if (!$this->confirm("The [{$value}] already exists. Do you want to replace it?")) { |
|
318 | 318 | continue; |
319 | 319 | } |
320 | 320 | } |
321 | 321 | |
322 | 322 | copy( |
323 | - base_path('stubs/seeds/'.$key), |
|
324 | - database_path('seeds/'.$value) |
|
323 | + base_path('stubs/seeds/' . $key), |
|
324 | + database_path('seeds/' . $value) |
|
325 | 325 | ); |
326 | 326 | } |
327 | 327 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * @param $src |
331 | 331 | * @param $dst |
332 | 332 | */ |
333 | - protected function recurse_copy($src,$dst) |
|
333 | + protected function recurse_copy($src, $dst) |
|
334 | 334 | { |
335 | 335 | $dir = opendir($src); |
336 | 336 | @mkdir($dst); |