Completed
Push — master ( d6c0d3...fbf2bc )
by Sergi Tur
03:14
created
src/Console/Routes/Controller.php 1 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/AdminLTERoute.php 1 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.