Completed
Push — master ( d6c0d3...fbf2bc )
by Sergi Tur
03:14
created
src/Providers/AdminLTETemplateServiceProvider.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
         }
27 27
 
28 28
         if ($this->app->runningInConsole()) {
29
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTE::class]);
30
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTEAlt::class]);
31
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebar::class]);
32
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebarAlt::class]);
33
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeAdminUserSeeder::class]);
34
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdmin::class]);
35
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdminAlt::class]);
36
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeView::class]);
37
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenu::class]);
38
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenuAlt::class]);
39
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTERoute::class]);
40
-            $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTERouteAlt::class]);
29
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTE::class ]);
30
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTEAlt::class ]);
31
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebar::class ]);
32
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebarAlt::class ]);
33
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeAdminUserSeeder::class ]);
34
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdmin::class ]);
35
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdminAlt::class ]);
36
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeView::class ]);
37
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenu::class ]);
38
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenuAlt::class ]);
39
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTERoute::class ]);
40
+            $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTERouteAlt::class ]);
41 41
         }
42 42
 
43
-        $this->app->bind('AdminLTE', function () {
43
+        $this->app->bind('AdminLTE', function() {
44 44
             return new \Acacha\AdminLTETemplateLaravel\AdminLTE();
45 45
         });
46 46
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         if (!$this->app->routesAreCached()) {
104 104
             $router = app('router');
105 105
 
106
-            $router->group(['namespace' => $this->getAppNamespace().'Http\Controllers'], function () {
106
+            $router->group([ 'namespace' => $this->getAppNamespace().'Http\Controllers' ], function() {
107 107
                 require __DIR__.'/../Http/routes.php';
108 108
             });
109 109
         }
Please login to merge, or discard this patch.
src/Console/Routes/RegularRoute.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected function getStubPath()
33 33
     {
34
-        return __DIR__ . '/../stubs/route.stub';
34
+        return __DIR__.'/../stubs/route.stub';
35 35
     }
36 36
 
37 37
     /**
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
     protected function obtainReplacements()
41 41
     {
42 42
         return [
43
-            'ROUTE_LINK' => $this->getReplacements()[0],
44
-            'ROUTE_VIEW' => $this->getReplacements()[1],
45
-            'ROUTE_METHOD' => $this->getReplacements()[2],
43
+            'ROUTE_LINK' => $this->getReplacements()[ 0 ],
44
+            'ROUTE_VIEW' => $this->getReplacements()[ 1 ],
45
+            'ROUTE_METHOD' => $this->getReplacements()[ 2 ],
46 46
         ];
47 47
     }
48 48
 }
Please login to merge, or discard this patch.
src/Console/Routes/Controller.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             $controllername = str_replace('/', '\\', $controllername);
22 22
         }
23 23
         if (str_contains($controllername, '@')) return ucfirst(preg_quote($controllername));
24
-        return ucfirst(preg_quote($controllername) . '@index');
24
+        return ucfirst(preg_quote($controllername).'@index');
25 25
     }
26 26
 
27 27
     /**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected function controllerWithoutMethod($controllername)
34 34
     {
35
-        if (str_contains($controller = $controllername, '@')) return ucfirst(substr($controllername, 0, strpos($controllername,'@')));
35
+        if (str_contains($controller = $controllername, '@')) return ucfirst(substr($controllername, 0, strpos($controllername, '@')));
36 36
         return ucfirst($controllername);
37 37
     }
38 38
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function controllerMethod($controllername)
46 46
     {
47
-        if (str_contains($controller = $controllername, '@')) return substr($controllername, strpos($controllername,'@')+1, strlen($controllername)  );
47
+        if (str_contains($controller = $controllername, '@')) return substr($controllername, strpos($controllername, '@') + 1, strlen($controllername));
48 48
         return 'index';
49 49
     }
50 50
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
         if (str_contains($controllername, '/')) {
21 21
             $controllername = str_replace('/', '\\', $controllername);
22 22
         }
23
-        if (str_contains($controllername, '@')) return ucfirst(preg_quote($controllername));
23
+        if (str_contains($controllername, '@')) {
24
+            return ucfirst(preg_quote($controllername));
25
+        }
24 26
         return ucfirst(preg_quote($controllername) . '@index');
25 27
     }
26 28
 
@@ -32,7 +34,9 @@  discard block
 block discarded – undo
32 34
      */
33 35
     protected function controllerWithoutMethod($controllername)
34 36
     {
35
-        if (str_contains($controller = $controllername, '@')) return ucfirst(substr($controllername, 0, strpos($controllername,'@')));
37
+        if (str_contains($controller = $controllername, '@')) {
38
+            return ucfirst(substr($controllername, 0, strpos($controllername,'@')));
39
+        }
36 40
         return ucfirst($controllername);
37 41
     }
38 42
 
@@ -44,7 +48,9 @@  discard block
 block discarded – undo
44 48
      */
45 49
     protected function controllerMethod($controllername)
46 50
     {
47
-        if (str_contains($controller = $controllername, '@')) return substr($controllername, strpos($controllername,'@')+1, strlen($controllername)  );
51
+        if (str_contains($controller = $controllername, '@')) {
52
+            return substr($controllername, strpos($controllername,'@')+1, strlen($controllername)  );
53
+        }
48 54
         return 'index';
49 55
     }
50 56
 
Please login to merge, or discard this patch.
src/Console/Routes/ControllerRoute.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
      * @param StubFileCompiler $compiler
21 21
      * @param Filesystem $filesystem
22 22
      */
23
-    public function __construct(StubFileCompiler $compiler,Filesystem $filesystem)
23
+    public function __construct(StubFileCompiler $compiler, Filesystem $filesystem)
24 24
     {
25
-        parent::__construct($compiler,$filesystem);
25
+        parent::__construct($compiler, $filesystem);
26 26
     }
27 27
 
28 28
     /**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected function getStubPath()
34 34
     {
35
-        return __DIR__ . '/../stubs/route_with_controller.stub';
35
+        return __DIR__.'/../stubs/route_with_controller.stub';
36 36
     }
37 37
 
38 38
     /**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
     protected function obtainReplacements()
44 44
     {
45 45
         return [
46
-            'ROUTE_LINK' => $this->getReplacements()[0],
47
-            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]),
48
-            'ROUTE_METHOD' => $this->getReplacements()[2],
46
+            'ROUTE_LINK' => $this->getReplacements()[ 0 ],
47
+            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[ 1 ]),
48
+            'ROUTE_METHOD' => $this->getReplacements()[ 2 ],
49 49
         ];
50 50
     }
51 51
 
Please login to merge, or discard this patch.
src/Console/Routes/ControllerResourceRoute.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected function getStubPath()
34 34
     {
35
-        return __DIR__ . '/../stubs/route_with_resource_controller.stub';
35
+        return __DIR__.'/../stubs/route_with_resource_controller.stub';
36 36
     }
37 37
 
38 38
     /**
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
     protected function obtainReplacements()
44 44
     {
45 45
         return [
46
-            'ROUTE_LINK' => $this->getReplacements()[0],
47
-            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]),
46
+            'ROUTE_LINK' => $this->getReplacements()[ 0 ],
47
+            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[ 1 ]),
48 48
         ];
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/Console/AdminLTERoute.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
         $this->warnIfRouteAlreadyExists($link = $this->argument('link'));
95 95
         $tmpfile = $this->createTmpFileWithRoute();
96 96
         $path = $this->getPath($tmpfile);
97
-        add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile() );
98
-        $this->info('Route ' . $link . ' added to ' .  $dstFile . '.');
97
+        add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile());
98
+        $this->info('Route '.$link.' added to '.$dstFile.'.');
99 99
         $this->postActions();
100 100
     }
101 101
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         $link = $this->removeTrailingSlashIfExists($link);
159 159
         $link = $this->removeDuplicatedTrailingSlashes($link);
160 160
         foreach (Route::getRoutes() as $value) {
161
-            if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), ['ANY'])) && $value->getPath() === $link) {
161
+            if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), [ 'ANY' ])) && $value->getPath() === $link) {
162 162
                 return true;
163 163
             }
164 164
         }
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
      * @param $link
172 172
      * @return string
173 173
      */
174
-    protected function removeTrailingSlashIfExists($link){
175
-        if (starts_with($link,'/')) return substr($link, 1);
174
+    protected function removeTrailingSlashIfExists($link) {
175
+        if (starts_with($link, '/')) return substr($link, 1);
176 176
         return $link;
177 177
     }
178 178
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     protected function removeDuplicatedTrailingSlashes($link)
186 186
     {
187
-        return preg_replace('/(\/+)/','/',$link);
187
+        return preg_replace('/(\/+)/', '/', $link);
188 188
     }
189 189
 
190 190
     /**
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      */
196 196
     protected function apiRouteExists($link)
197 197
     {
198
-        return $this->webRouteExists('api/v1/' . $link);
198
+        return $this->webRouteExists('api/v1/'.$link);
199 199
     }
200 200
 
201 201
     /**
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
      */
219 219
     protected function getPath($tmpfile)
220 220
     {
221
-        return stream_get_meta_data($tmpfile)['uri'];
221
+        return stream_get_meta_data($tmpfile)[ 'uri' ];
222 222
     }
223 223
 
224 224
     /**
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
     protected function getRouteCode()
230 230
     {
231 231
         $type = $this->option('type');
232
-        $class = isset(static::$lookup[$type])
233
-            ? static::$lookup[$type]
232
+        $class = isset(static::$lookup[ $type ])
233
+            ? static::$lookup[ $type ]
234 234
             : RegularRoute::class;
235 235
         /** @var GeneratesCode $route */
236
-        $route = new $class($this->compiler,$this->filesystem);
236
+        $route = new $class($this->compiler, $this->filesystem);
237 237
         $route->setReplacements([
238 238
             $this->argument('link'),
239 239
             $this->action(),
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     protected function method()
251 251
     {
252
-        if ( strtolower($this->option('method')) == 'head' ) return 'get';
252
+        if (strtolower($this->option('method')) == 'head') return 'get';
253 253
         return strtolower($this->option('method'));
254 254
     }
255 255
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      */
281 281
     protected function validateMethod()
282 282
     {
283
-        if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) {
283
+        if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) {
284 284
             throw new MethodNotAllowedException($methods);
285 285
         }
286 286
     }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      */
291 291
     protected function validateType()
292 292
     {
293
-        if (! in_array( strtolower($this->option('type')),['regular','controller','resource'])) {
293
+        if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) {
294 294
             throw new RouteTypeNotValid();
295 295
         }
296 296
     }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
         Artisan::call('make:view', [
323 323
             'name' => $this->action()
324 324
         ]);
325
-        $this->info('View ' . $this->action() .'.blade.php created.');
325
+        $this->info('View '.$this->action().'.blade.php created.');
326 326
     }
327 327
 
328 328
     /**
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
         Artisan::call('make:controller', [
334 334
             'name' => $controller = $this->controllerWithoutMethod($this->action())
335 335
         ]);
336
-        $this->addMethodToController($controller,$this->controllerMethod($this->action()));
337
-        $this->info('Controller ' . $controller .' created.');
336
+        $this->addMethodToController($controller, $this->controllerMethod($this->action()));
337
+        $this->info('Controller '.$controller.' created.');
338 338
     }
339 339
 
340 340
     /**
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             'name' => $controller = $this->controllerWithoutMethod($this->action()),
347 347
             '--resource' => true
348 348
         ]);
349
-        $this->info('Resource Controller ' . $controller .' created.');
349
+        $this->info('Resource Controller '.$controller.' created.');
350 350
     }
351 351
 
352 352
     /**
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
     {
360 360
         $tmpfile = $this->createTmpFileWithMethod($controllerMethod);
361 361
         $path = $this->getPath($tmpfile);
362
-        add_file_into_file('\/\/',$path,app_path('Http/Controllers/' . $controller . '.php'));
362
+        add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php'));
363 363
     }
364 364
 
365 365
     /**
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
      */
399 399
     protected function getMethodStubPath()
400 400
     {
401
-        return __DIR__ . '/stubs/method.stub';
401
+        return __DIR__.'/stubs/method.stub';
402 402
     }
403 403
 
404 404
 }
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -106,7 +106,9 @@  discard block
 block discarded – undo
106 106
      */
107 107
     protected function mountpoint()
108 108
     {
109
-        if ($this->option('api')) return '#adminlte_api_routes';
109
+        if ($this->option('api')) {
110
+            return '#adminlte_api_routes';
111
+        }
110 112
         return '#adminlte_routes';
111 113
     }
112 114
 
@@ -116,7 +118,9 @@  discard block
 block discarded – undo
116 118
      * @return string
117 119
      */
118 120
     protected function destinationFile() {
119
-        if ($this->option('api')) return base_path($this->api_routes_path);
121
+        if ($this->option('api')) {
122
+            return base_path($this->api_routes_path);
123
+        }
120 124
         return base_path($this->web_routes_path);
121 125
     }
122 126
 
@@ -143,7 +147,9 @@  discard block
 block discarded – undo
143 147
      */
144 148
     protected function routeExists($link)
145 149
     {
146
-        if ($this->option('api')) return $this->apiRouteExists($link);
150
+        if ($this->option('api')) {
151
+            return $this->apiRouteExists($link);
152
+        }
147 153
         return $this->webRouteExists($link);
148 154
     }
149 155
 
@@ -172,7 +178,9 @@  discard block
 block discarded – undo
172 178
      * @return string
173 179
      */
174 180
     protected function removeTrailingSlashIfExists($link){
175
-        if (starts_with($link,'/')) return substr($link, 1);
181
+        if (starts_with($link,'/')) {
182
+            return substr($link, 1);
183
+        }
176 184
         return $link;
177 185
     }
178 186
 
@@ -249,7 +257,9 @@  discard block
 block discarded – undo
249 257
      */
250 258
     protected function method()
251 259
     {
252
-        if ( strtolower($this->option('method')) == 'head' ) return 'get';
260
+        if ( strtolower($this->option('method')) == 'head' ) {
261
+            return 'get';
262
+        }
253 263
         return strtolower($this->option('method'));
254 264
     }
255 265
 
@@ -300,7 +310,9 @@  discard block
 block discarded – undo
300 310
      */
301 311
     protected function postActions()
302 312
     {
303
-        if ($this->option('createaction') != null) $this->createAction();
313
+        if ($this->option('createaction') != null) {
314
+            $this->createAction();
315
+        }
304 316
 
305 317
     }
306 318
 
@@ -309,8 +321,12 @@  discard block
 block discarded – undo
309 321
      */
310 322
     protected function createAction()
311 323
     {
312
-        if (strtolower($this->option('type')) == 'regular' || $this->option('type') == null) return $this->createView();
313
-        if (strtolower($this->option('type')) == 'controller') return $this->createController();
324
+        if (strtolower($this->option('type')) == 'regular' || $this->option('type') == null) {
325
+            return $this->createView();
326
+        }
327
+        if (strtolower($this->option('type')) == 'controller') {
328
+            return $this->createController();
329
+        }
314 330
         return $this->createResourceController();
315 331
     }
316 332
 
Please login to merge, or discard this patch.
routes/web.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::get('/', function () {
14
+Route::get('/', function() {
15 15
     return view('welcome');
16 16
 });
17 17
 
18
-Route::group(['middleware' => 'auth'], function () {
18
+Route::group([ 'middleware' => 'auth' ], function() {
19 19
 //    Route::get('/link1', function ()    {
20 20
 //        // Uses Auth Middleware
21 21
 //    });
Please login to merge, or discard this patch.
routes/api.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 |
14 14
 */
15 15
 
16
-Route::get('/user', function (Request $request) {
16
+Route::get('/user', function(Request $request) {
17 17
     return $request->user();
18 18
 })->middleware('auth:api');
19 19
 
20
-Route::group(['prefix' => 'v1','middleware' => 'auth:api'], function () {
20
+Route::group([ 'prefix' => 'v1', 'middleware' => 'auth:api' ], function() {
21 21
 //    Route::resource('task', 'TasksController');
22 22
 
23 23
     //Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly.
Please login to merge, or discard this patch.