Completed
Push — master ( 6290c3...31e20d )
by Nicolas
05:11
created
src/Commands/MigrationCommand.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     /**
68 68
      * @throws InvalidMigrationNameException
69 69
      *
70
-     * @return mixed
70
+     * @return Stub
71 71
      */
72 72
     protected function getTemplateContents()
73 73
     {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     }
106 106
 
107 107
     /**
108
-     * @return mixed
108
+     * @return string
109 109
      */
110 110
     protected function getDestinationFilePath()
111 111
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $generatorPath = $this->laravel['modules']->config('paths.generator.migration');
115 115
 
116
-        return $path . $generatorPath . '/' . $this->getFileName() . '.php';
116
+        return $path.$generatorPath.'/'.$this->getFileName().'.php';
117 117
     }
118 118
 
119 119
     /**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     private function getFileName()
123 123
     {
124
-        return date('Y_m_d_His_') . $this->getSchemaName();
124
+        return date('Y_m_d_His_').$this->getSchemaName();
125 125
     }
126 126
 
127 127
     /**
Please login to merge, or discard this patch.
src/Commands/ModelCommand.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @return mixed
62
+     * @return string
63 63
      */
64 64
     protected function getTemplateContents()
65 65
     {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     }
79 79
 
80 80
     /**
81
-     * @return mixed
81
+     * @return string
82 82
      */
83 83
     protected function getDestinationFilePath()
84 84
     {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     }
91 91
 
92 92
     /**
93
-     * @return mixed|string
93
+     * @return string
94 94
      */
95 95
     private function getModelName()
96 96
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 
87 87
         $seederPath = $this->laravel['modules']->config('paths.generator.model');
88 88
 
89
-        return $path . $seederPath . '/' . $this->getModelName() . '.php';
89
+        return $path.$seederPath.'/'.$this->getModelName().'.php';
90 90
     }
91 91
 
92 92
     /**
Please login to merge, or discard this patch.
src/Commands/SeedMakeCommand.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     }
58 58
 
59 59
     /**
60
-     * @return mixed
60
+     * @return string
61 61
      */
62 62
     protected function getTemplateContents()
63 63
     {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     }
71 71
 
72 72
     /**
73
-     * @return mixed
73
+     * @return string
74 74
      */
75 75
     protected function getDestinationFilePath()
76 76
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         $seederPath = $this->laravel['modules']->config('paths.generator.seeder');
83 83
 
84
-        return $path . $seederPath . '/' . $this->getSeederName() . '.php';
84
+        return $path.$seederPath.'/'.$this->getSeederName().'.php';
85 85
     }
86 86
 
87 87
     /**
@@ -93,6 +93,6 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $end = $this->option('master') ? 'DatabaseSeeder' : 'TableSeeder';
95 95
 
96
-        return Str::studly($this->argument('name')) . $end;
96
+        return Str::studly($this->argument('name')).$end;
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -335,7 +335,7 @@
 block discarded – undo
335 335
      *
336 336
      * @param $stub
337 337
      *
338
-     * @return Stub
338
+     * @return string
339 339
      */
340 340
     protected function getStubContents($stub)
341 341
     {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     public function generateFolders()
272 272
     {
273 273
         foreach ($this->getFolders() as $folder) {
274
-            $path = $this->module->getModulePath($this->getName()) . '/' . $folder;
274
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder;
275 275
 
276 276
             $this->filesystem->makeDirectory($path, 0755, true);
277 277
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     public function generateGitKeep($path)
288 288
     {
289
-        $this->filesystem->put($path . '/.gitkeep', '');
289
+        $this->filesystem->put($path.'/.gitkeep', '');
290 290
     }
291 291
 
292 292
     /**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     public function generateFiles()
296 296
     {
297 297
         foreach ($this->getFiles() as $stub => $file) {
298
-            $path = $this->module->getModulePath($this->getName()) . $file;
298
+            $path = $this->module->getModulePath($this->getName()).$file;
299 299
 
300 300
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
301 301
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
         ]);
320 320
 
321 321
         $this->console->call('module:make-provider', [
322
-            'name' => $this->getName() . 'ServiceProvider',
322
+            'name' => $this->getName().'ServiceProvider',
323 323
             'module' => $this->getName(),
324 324
             '--master' => true,
325 325
         ]);
326 326
 
327 327
         $this->console->call('module:make-controller', [
328
-            'controller' => $this->getName() . 'Controller',
328
+            'controller' => $this->getName().'Controller',
329 329
             'module' => $this->getName(),
330 330
         ]);
331 331
     }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
     protected function getStubContents($stub)
341 341
     {
342 342
         return (new Stub(
343
-            '/' . $stub . '.stub',
343
+            '/'.$stub.'.stub',
344 344
             $this->getReplacement($stub))
345 345
         )->render();
346 346
     }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         $replaces = [];
374 374
 
375 375
         foreach ($keys as $key) {
376
-            if (method_exists($this, $method = 'get' . ucfirst(studly_case(strtolower($key))) . 'Replacement')) {
376
+            if (method_exists($this, $method = 'get'.ucfirst(studly_case(strtolower($key))).'Replacement')) {
377 377
                 $replaces[$key] = call_user_func([$this, $method]);
378 378
             } else {
379 379
                 $replaces[$key] = null;
Please login to merge, or discard this patch.
src/LaravelModulesServiceProvider.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function setupStubPath()
57 57
     {
58
-        $this->app->booted(function ($app) {
59
-            Stub::setBasePath(__DIR__ . '/Commands/stubs');
58
+        $this->app->booted(function($app) {
59
+            Stub::setBasePath(__DIR__.'/Commands/stubs');
60 60
 
61 61
             if ($app['modules']->config('stubs.enabled') === true) {
62 62
                 Stub::setBasePath($app['modules']->config('stubs.path'));
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -2,12 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Nwidart\Modules;
4 4
 
5
-use Collective\Html\FormFacade;
6
-use Collective\Html\HtmlFacade;
7
-use Collective\Html\HtmlServiceProvider;
8
-use Illuminate\Foundation\AliasLoader;
9 5
 use Illuminate\Support\ServiceProvider;
10
-use Nwidart\Modules\Facades\Module;
11 6
 use Nwidart\Modules\Providers\BootstrapServiceProvider;
12 7
 use Nwidart\Modules\Providers\ConsoleServiceProvider;
13 8
 use Nwidart\Modules\Providers\ContractsServiceProvider;
Please login to merge, or discard this patch.
src/Migrations/Migrator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function getMigrations($reverse = false)
53 53
     {
54
-        $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php');
54
+        $files = $this->laravel['files']->glob($this->getPath().'/*_*.php');
55 55
 
56 56
         // Once we have the array of files in the directory we will just remove the
57 57
         // extension and take the basename of the file which is all we need when
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
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);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $path = $this->getPath();
180 180
 
181 181
         foreach ($files as $file) {
182
-            $this->laravel['files']->requireOnce($path . '/' . $file . '.php');
182
+            $this->laravel['files']->requireOnce($path.'/'.$file.'.php');
183 183
         }
184 184
     }
185 185
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Module.php 2 patches
Doc Comments   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     {
160 160
         $lowerName = $this->getLowerName();
161 161
 
162
-        $langPath = $this->getPath() . "/Resources/lang";
162
+        $langPath = $this->getPath()."/Resources/lang";
163 163
 
164 164
         if (is_dir($langPath)) {
165 165
             $this->loadTranslationsFrom($langPath, $lowerName);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             $file = 'module.json';
178 178
         }
179 179
 
180
-        return new Json($this->getPath() . '/' . $file, $this->app['files']);
180
+        return new Json($this->getPath().'/'.$file, $this->app['files']);
181 181
     }
182 182
 
183 183
     /**
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     protected function fireEvent($event)
229 229
     {
230
-        $this->app['events']->fire(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]);
230
+        $this->app['events']->fire(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
231 231
     }
232 232
 
233 233
     /**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     protected function registerFiles()
258 258
     {
259 259
         foreach ($this->get('files', []) as $file) {
260
-            include $this->path . '/' . $file;
260
+            include $this->path.'/'.$file;
261 261
         }
262 262
     }
263 263
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      */
381 381
     public function getExtraPath($path)
382 382
     {
383
-        return $this->getPath() . '/' . $path;
383
+        return $this->getPath().'/'.$path;
384 384
     }
385 385
 
386 386
     /**
Please login to merge, or discard this patch.
src/Publishing/Publisher.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.