@@ -20,7 +20,9 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -106,7 +106,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |