@@ -335,7 +335,7 @@ |
||
335 | 335 | * |
336 | 336 | * @param $stub |
337 | 337 | * |
338 | - * @return Stub |
|
338 | + * @return string |
|
339 | 339 | */ |
340 | 340 | protected function getStubContents($stub) |
341 | 341 | { |
@@ -107,7 +107,7 @@ |
||
107 | 107 | /** |
108 | 108 | * Get the services provided by the provider. |
109 | 109 | * |
110 | - * @return array |
|
110 | + * @return string[] |
|
111 | 111 | */ |
112 | 112 | public function provides() |
113 | 113 | { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setupStubPath() |
57 | 57 | { |
58 | - $this->app->booted(function ($app) { |
|
58 | + $this->app->booted(function($app) { |
|
59 | 59 | Stub::setBasePath(__DIR__.'/Commands/stubs'); |
60 | 60 | |
61 | 61 | if ($app['modules']->config('stubs.enabled') === true) { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function registerNamespaces() |
71 | 71 | { |
72 | - $configPath = __DIR__ . '/../config/config.php'; |
|
72 | + $configPath = __DIR__.'/../config/config.php'; |
|
73 | 73 | $this->mergeConfigFrom($configPath, 'modules'); |
74 | 74 | $this->publishes([ |
75 | 75 | $configPath => config_path('modules.php') |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function registerServices() |
99 | 99 | { |
100 | - $this->app->singleton('modules', function ($app) { |
|
100 | + $this->app->singleton('modules', function($app) { |
|
101 | 101 | $path = $app['config']->get('modules.paths.modules'); |
102 | 102 | |
103 | 103 | return new Repository($app, $path); |
@@ -248,7 +248,7 @@ |
||
248 | 248 | * |
249 | 249 | * @param array $migrations |
250 | 250 | * |
251 | - * @return array |
|
251 | + * @return \Illuminate\Support\Collection |
|
252 | 252 | */ |
253 | 253 | public function getLast($migrations) |
254 | 254 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return array(); |
61 | 61 | } |
62 | 62 | |
63 | - $files = array_map(function ($file) { |
|
63 | + $files = array_map(function($file) { |
|
64 | 64 | return str_replace('.php', '', basename($file)); |
65 | 65 | |
66 | 66 | }, $files); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | $result = $query->orderBy('migration', 'desc')->get(); |
261 | 261 | |
262 | - return collect($result)->map(function ($item) { |
|
262 | + return collect($result)->map(function($item) { |
|
263 | 263 | return (array) $item; |
264 | 264 | })->lists('migration'); |
265 | 265 | } |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * The constructor. |
35 | 35 | * |
36 | 36 | * @param Application $app |
37 | - * @param $name |
|
38 | - * @param $path |
|
37 | + * @param string $name |
|
38 | + * @param string $path |
|
39 | 39 | */ |
40 | 40 | public function __construct(Application $app, $name, $path) |
41 | 41 | { |
@@ -167,6 +167,7 @@ discard block |
||
167 | 167 | /** |
168 | 168 | * Get json contents. |
169 | 169 | * |
170 | + * @param string $file |
|
170 | 171 | * @return Json |
171 | 172 | */ |
172 | 173 | public function json($file = null) |
@@ -194,7 +195,7 @@ discard block |
||
194 | 195 | /** |
195 | 196 | * Get a specific data from composer.json file by given the key. |
196 | 197 | * |
197 | - * @param $key |
|
198 | + * @param string $key |
|
198 | 199 | * @param null $default |
199 | 200 | * |
200 | 201 | * @return mixed |
@@ -272,7 +273,7 @@ discard block |
||
272 | 273 | /** |
273 | 274 | * Determine whether the given status same with the current module status. |
274 | 275 | * |
275 | - * @param $status |
|
276 | + * @param integer $status |
|
276 | 277 | * |
277 | 278 | * @return bool |
278 | 279 | */ |
@@ -324,9 +325,9 @@ discard block |
||
324 | 325 | /** |
325 | 326 | * Set active state for current module. |
326 | 327 | * |
327 | - * @param $active |
|
328 | + * @param integer $active |
|
328 | 329 | * |
329 | - * @return bool |
|
330 | + * @return integer |
|
330 | 331 | */ |
331 | 332 | public function setActive($active) |
332 | 333 | { |
@@ -336,7 +337,7 @@ discard block |
||
336 | 337 | /** |
337 | 338 | * Disable the current module. |
338 | 339 | * |
339 | - * @return bool |
|
340 | + * @return boolean|null |
|
340 | 341 | */ |
341 | 342 | public function disable() |
342 | 343 | { |
@@ -175,7 +175,7 @@ |
||
175 | 175 | $file = 'module.json'; |
176 | 176 | } |
177 | 177 | |
178 | - return new Json($this->getPath() . '/' . $file, $this->app['files']); |
|
178 | + return new Json($this->getPath().'/'.$file, $this->app['files']); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -88,7 +88,7 @@ |
||
88 | 88 | /** |
89 | 89 | * Get module instance. |
90 | 90 | * |
91 | - * @return \Nwidart\Modules\Module |
|
91 | + * @return string |
|
92 | 92 | */ |
93 | 93 | public function getModule() |
94 | 94 | { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * Get scanned modules paths. |
91 | 91 | * |
92 | - * @return array |
|
92 | + * @return string[] |
|
93 | 93 | */ |
94 | 94 | public function getScanPaths() |
95 | 95 | { |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | /** |
366 | 366 | * Get module path for a specific module. |
367 | 367 | * |
368 | - * @param $module |
|
368 | + * @param string $module |
|
369 | 369 | * |
370 | 370 | * @return string |
371 | 371 | */ |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | /** |
394 | 394 | * Get a specific config data from a configuration file. |
395 | 395 | * |
396 | - * @param $key |
|
396 | + * @param string $key |
|
397 | 397 | * |
398 | 398 | * @return mixed |
399 | 399 | */ |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | /** |
434 | 434 | * Get module used for cli session. |
435 | 435 | * |
436 | - * @return string |
|
436 | + * @return Module |
|
437 | 437 | */ |
438 | 438 | public function getUsedNow() |
439 | 439 | { |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | /** |
444 | 444 | * Get used now. |
445 | 445 | * |
446 | - * @return string |
|
446 | + * @return Module |
|
447 | 447 | */ |
448 | 448 | public function getUsed() |
449 | 449 | { |
@@ -474,7 +474,6 @@ discard block |
||
474 | 474 | * Get asset url from a specific module. |
475 | 475 | * |
476 | 476 | * @param string $asset |
477 | - * @param bool $secure |
|
478 | 477 | * |
479 | 478 | * @return string |
480 | 479 | */ |
@@ -518,7 +517,7 @@ discard block |
||
518 | 517 | * |
519 | 518 | * @param string $name |
520 | 519 | * |
521 | - * @return bool |
|
520 | + * @return boolean|null |
|
522 | 521 | */ |
523 | 522 | public function enable($name) |
524 | 523 | { |
@@ -530,7 +529,7 @@ discard block |
||
530 | 529 | * |
531 | 530 | * @param string $name |
532 | 531 | * |
533 | - * @return bool |
|
532 | + * @return boolean|null |
|
534 | 533 | */ |
535 | 534 | public function disable($name) |
536 | 535 | { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function getCached() |
177 | 177 | { |
178 | - return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
178 | + return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
179 | 179 | return $this->toCollection()->toArray(); |
180 | 180 | }); |
181 | 181 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | { |
264 | 264 | $modules = $this->enabled(); |
265 | 265 | |
266 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
266 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
267 | 267 | if ($a->order == $b->order) { |
268 | 268 | return 0; |
269 | 269 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function toArray() |
26 | 26 | { |
27 | - return array_map(function ($value) { |
|
27 | + return array_map(function($value) { |
|
28 | 28 | if ($value instanceof Module) { |
29 | 29 | return $value->json()->getAttributes(); |
30 | 30 | } |
@@ -135,7 +135,7 @@ |
||
135 | 135 | $process->setTimeout($this->timeout); |
136 | 136 | |
137 | 137 | if ($this->console instanceof Command) { |
138 | - $process->run(function ($type, $line) { |
|
138 | + $process->run(function($type, $line) { |
|
139 | 139 | $this->console->line($line); |
140 | 140 | }); |
141 | 141 | } |
@@ -122,7 +122,7 @@ |
||
122 | 122 | return json_decode($this->getContents(), 1); |
123 | 123 | } |
124 | 124 | |
125 | - return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function () { |
|
125 | + return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function() { |
|
126 | 126 | return json_decode($this->getContents(), 1); |
127 | 127 | }); |
128 | 128 | } |