Completed
Push — master ( 8170f1...05782f )
by Sergi Tur
02:56
created
src/Console/AdminLTERoute.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $tmpfile = $this->createTmpFileWithRoute();
98 98
         $path = $this->getPath($tmpfile);
99 99
         add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile());
100
-        $this->info('Route ' . $link . ' added to ' .  $dstFile . '.');
100
+        $this->info('Route '.$link.' added to '.$dstFile.'.');
101 101
         $this->postActions();
102 102
     }
103 103
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $link = $this->removeTrailingSlashIfExists($link);
168 168
         $link = $this->removeDuplicatedTrailingSlashes($link);
169 169
         foreach (Route::getRoutes() as $value) {
170
-            if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), ['ANY'])) &&
170
+            if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), [ 'ANY' ])) &&
171 171
                 $value->getPath() === $link) {
172 172
                 return true;
173 173
             }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     protected function apiRouteExists($link)
210 210
     {
211
-        return $this->webRouteExists('api/v1/' . $link);
211
+        return $this->webRouteExists('api/v1/'.$link);
212 212
     }
213 213
 
214 214
     /**
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     protected function getPath($tmpfile)
233 233
     {
234
-        return stream_get_meta_data($tmpfile)['uri'];
234
+        return stream_get_meta_data($tmpfile)[ 'uri' ];
235 235
     }
236 236
 
237 237
     /**
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
     protected function getRouteCode()
243 243
     {
244 244
         $type = $this->option('type');
245
-        $class = isset(static::$lookup[$type])
246
-            ? static::$lookup[$type]
245
+        $class = isset(static::$lookup[ $type ])
246
+            ? static::$lookup[ $type ]
247 247
             : RegularRoute::class;
248 248
         /** @var GeneratesCode $route */
249 249
         $route = new $class($this->compiler, $this->filesystem);
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         if ($this->argument('action') != null) {
279 279
             return $this->argument('action');
280 280
         }
281
-        if (strtolower($this->option('type')) != 'regular' ) return $this->argument('link') . 'Controller';
281
+        if (strtolower($this->option('type')) != 'regular') return $this->argument('link').'Controller';
282 282
         return $this->argument('link');
283 283
     }
284 284
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      */
297 297
     protected function validateMethod()
298 298
     {
299
-        if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) {
299
+        if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) {
300 300
             throw new MethodNotAllowedException($methods);
301 301
         }
302 302
     }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      */
307 307
     protected function validateType()
308 308
     {
309
-        if (! in_array(strtolower($this->option('type')), ['regular','controller','resource'])) {
309
+        if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) {
310 310
             throw new RouteTypeNotValid();
311 311
         }
312 312
     }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         Artisan::call('make:view', [
347 347
             'name' => $name
348 348
         ]);
349
-        $this->info('View ' . $name .'.blade.php created.');
349
+        $this->info('View '.$name.'.blade.php created.');
350 350
     }
351 351
 
352 352
     /**
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             'name' => $controller = $this->controllerWithoutMethod($this->action())
359 359
         ]);
360 360
         $this->addMethodToController($controller, $this->controllerMethod($this->action()));
361
-        $this->info('Controller ' . $controller .' created.');
361
+        $this->info('Controller '.$controller.' created.');
362 362
         $this->createView($this->argument('link'));
363 363
     }
364 364
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
             'name' => $controller = $this->controllerWithoutMethod($this->action()),
372 372
             '--resource' => true
373 373
         ]);
374
-        $this->info('Resource Controller ' . $controller .' created.');
374
+        $this->info('Resource Controller '.$controller.' created.');
375 375
         $this->createView($this->argument('link'));
376 376
     }
377 377
 
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
     {
386 386
         $tmpfile = $this->createTmpFileWithMethod($controllerMethod);
387 387
         $path = $this->getPath($tmpfile);
388
-        add_file_into_file('\/\/', $path, app_path('Http/Controllers/' . $controller . '.php'));
388
+        add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php'));
389 389
     }
390 390
 
391 391
     /**
@@ -425,6 +425,6 @@  discard block
 block discarded – undo
425 425
      */
426 426
     protected function getMethodStubPath()
427 427
     {
428
-        return __DIR__ . '/stubs/method.stub';
428
+        return __DIR__.'/stubs/method.stub';
429 429
     }
430 430
 }
Please login to merge, or discard this patch.