Completed
Push — master ( d5f30b...45dacb )
by Marcin
02:22
created
src/Console/Traits/ModuleCreator.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -85,6 +85,9 @@
 block discarded – undo
85 85
         return $this->option('group') ?: $this->laravel['modular.config']->stubsDefaultGroup();
86 86
     }
87 87
 
88
+    /**
89
+     * @return string
90
+     */
88 91
     protected function getFilesStubGroup()
89 92
     {
90 93
         return $this->option('group') ?: $this->laravel['modular.config']->filesStubsDefaultGroup();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         if ($directories->isEmpty()) {
105 105
             $this->warn("[Module {$module->name()}] No explicit directories created");
106 106
         } else {
107
-            $directories->each(function ($directory) use ($module) {
107
+            $directories->each(function($directory) use ($module) {
108 108
                 $this->createDirectory($module, $directory);
109 109
             });
110 110
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
         $replacements = $subModule ? ['class' => $subModule] : [];
164 164
 
165
-        $files->each(function ($stubFile, $moduleFile) use ($module, $stubGroup, $replacements) {
165
+        $files->each(function($stubFile, $moduleFile) use ($module, $stubGroup, $replacements) {
166 166
             $this->copyStubFileIntoModule($module, $stubFile, $stubGroup,
167 167
                 $moduleFile, $replacements);
168 168
         });
Please login to merge, or discard this patch.
src/Services/Modular.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @param string $type
103 103
      *
104
-     * @return array
104
+     * @return Collection
105 105
      */
106 106
     public function withRoutes($type)
107 107
     {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * Get all routable modules (active and having routes file)
113 113
      *
114
-     * @return array
114
+     * @return Collection
115 115
      */
116 116
     public function withFactories()
117 117
     {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      * Get all modules that have service providers (active and having service
123 123
      * provider file)
124 124
      *
125
-     * @return array
125
+     * @return Collection
126 126
      */
127 127
     public function withServiceProviders()
128 128
     {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * Get all modules that have seeders (active and having seeder file)
134 134
      *
135
-     * @return array
135
+     * @return Collection
136 136
      */
137 137
     public function withSeeders()
138 138
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function seed(Seeder $seeder)
51 51
     {
52
-        $this->withSeeders()->each(function ($module) use ($seeder) {
52
+        $this->withSeeders()->each(function($module) use ($seeder) {
53 53
             /* @var Module $module */
54 54
             $seeder->call($module->seederClass());
55 55
         });
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function loadRoutes(Registrar $router, $type = null)
65 65
     {
66
-        $this->withRoutes($type)->each(function ($module) use ($router, $type) {
66
+        $this->withRoutes($type)->each(function($module) use ($router, $type) {
67 67
             /* @var Module $module */
68 68
             $router->group(['namespace' => $module->routingControllerNamespace()],
69
-                function ($router) use ($module, $type) {
69
+                function($router) use ($module, $type) {
70 70
                     $this->app['files']->requireOnce($this->app->basePath() .
71 71
                         DIRECTORY_SEPARATOR .
72 72
                         $module->routesFilePath(compact('type')));
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function loadFactories()
81 81
     {
82
-        $this->withFactories()->each(function ($module) {
82
+        $this->withFactories()->each(function($module) {
83 83
             /* @var Module $module */
84 84
             $this->app['files']->requireOnce($module->factoryFilePath());
85 85
         });
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function loadServiceProviders()
92 92
     {
93
-        $this->withServiceProviders()->each(function ($module) {
93
+        $this->withServiceProviders()->each(function($module) {
94 94
             /* @var Module $module */
95 95
             $this->app->register($module->serviceProviderClass());
96 96
         });
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     protected function filterActiveByMethod($requirement, array $data = [])
152 152
     {
153 153
         return $this->modules()
154
-            ->filter(function ($module) use ($requirement, $data) {
154
+            ->filter(function($module) use ($requirement, $data) {
155 155
                 return $module->active() && $module->$requirement($data);
156 156
             })->values();
157 157
     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public function active()
175 175
     {
176
-        return $this->modules()->filter(function ($module) {
176
+        return $this->modules()->filter(function($module) {
177 177
             return $module->active();
178 178
         })->values();
179 179
     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     {
200 200
         $this->modules = collect();
201 201
 
202
-        collect($this->config->modules())->each(function ($options, $name) {
202
+        collect($this->config->modules())->each(function($options, $name) {
203 203
             $this->modules->push(new Module($name, $this->app, $options));
204 204
         });
205 205
     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      */
214 214
     public function find($name)
215 215
     {
216
-        return $this->modules()->first(function ($module) use ($name) {
216
+        return $this->modules()->first(function($module) use ($name) {
217 217
             /* @var Module $module */
218 218
             return $module->name() == $name;
219 219
         });
Please login to merge, or discard this patch.
stubs/app/Core/AbstractRepository.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
      *
114 114
      * @param array|int $ids
115 115
      *
116
-     * @return bool
116
+     * @return integer
117 117
      */
118 118
     public function destroy($ids)
119 119
     {
Please login to merge, or discard this patch.
src/Providers/ModularServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
     public function register()
28 28
     {
29 29
         // register module binding
30
-        $this->app->singleton('modular.config', function ($app) {
30
+        $this->app->singleton('modular.config', function($app) {
31 31
             return new Config($app);
32 32
         });
33 33
 
34
-        $this->app->singleton('modular', function ($app) {
34
+        $this->app->singleton('modular', function($app) {
35 35
             return new Modular($app, $app['modular.config']);
36 36
         });
37 37
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $publishedStubsPath = $this->app['modular.config']->stubsPath();
113 113
 
114 114
         collect(glob($templatesPath . '/*/{,.}*.stub', GLOB_BRACE))
115
-            ->each(function ($file) use ($publishedStubsPath, $pathLength) {
115
+            ->each(function($file) use ($publishedStubsPath, $pathLength) {
116 116
                 $this->filesToPublish->put($file,
117 117
                     $publishedStubsPath . DIRECTORY_SEPARATOR .
118 118
                     mb_substr($file, $pathLength + 1));
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     protected function addAppFilesToPublished()
130 130
     {
131 131
         $appPath = $this->getAppSamplePath();
132
-        collect(glob($appPath . '/*/*'))->each(function ($file) use ($appPath) {
132
+        collect(glob($appPath . '/*/*'))->each(function($file) use ($appPath) {
133 133
             $this->filesToPublish->put($file,
134 134
                 $this->app['path'] . DIRECTORY_SEPARATOR .
135 135
                 mb_substr($file, mb_strlen($appPath) + 1));
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
         // add to paths all migration directories from modules
179 179
         collect($this->app['modular']->active())
180
-            ->each(function ($module) use ($paths) {
180
+            ->each(function($module) use ($paths) {
181 181
                 /* @var Module $module */
182 182
                 $paths->push($module->migrationsPath());
183 183
             });
Please login to merge, or discard this patch.
src/Console/Commands/ModuleFiles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             return;
45 45
         }
46 46
 
47
-        $subModules->each(function ($subModule) use ($module, $stubGroup) {
47
+        $subModules->each(function($subModule) use ($module, $stubGroup) {
48 48
             $this->createSubModule($module, $subModule, $stubGroup);
49 49
         });
50 50
     }
Please login to merge, or discard this patch.
src/Console/Commands/ModuleMake.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         // verify whether stub directory exists
39 39
         $this->verifyStubGroup($stubGroup);
40 40
 
41
-        $moduleNames->each(function ($moduleName) use ($stubGroup) {
41
+        $moduleNames->each(function($moduleName) use ($stubGroup) {
42 42
             $module = $this->createModuleObject($moduleName);
43 43
 
44 44
             // module added to configuration or module directory exists
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         // getting modified content of config file
104 104
         $result =
105 105
             preg_replace_callback($this->laravel['modular.config']->autoAddPattern(),
106
-                function ($matches) use ($module, $configFile) {
106
+                function($matches) use ($module, $configFile) {
107 107
                     return $matches[1] . $matches[2] .
108 108
                     $this->replace($this->laravel['modular.config']->autoAddTemplate(),
109 109
                         $module) .
Please login to merge, or discard this patch.
src/Console/Commands/ModuleSeed.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
         $options = $this->getOptions();
42 42
 
43
-        $modules->each(function ($module) use ($options) {
43
+        $modules->each(function($module) use ($options) {
44 44
             /* @var Module $module */
45 45
             $class = $module->seederClass($this->option('class'));
46 46
 
Please login to merge, or discard this patch.
src/Console/Traits/ModuleVerification.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     {
57 57
         $modules = collect();
58 58
 
59
-        $moduleNames->each(function ($name) use ($verifyActive, $modules) {
59
+        $moduleNames->each(function($name) use ($verifyActive, $modules) {
60 60
             /** @var Module $module */
61 61
             $module = $this->laravel['modular']->find($name);
62 62
 
Please login to merge, or discard this patch.
src/Traits/Replacer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'namespace' => rtrim($this->configClass()->modulesNamespace(), '\\'),
45 45
             'plural|lower' => mb_strtolower(str_plural($module->name())),
46 46
         ])->merge($definedReplacements)
47
-            ->each(function ($value, $key) use ($replacements) {
47
+            ->each(function($value, $key) use ($replacements) {
48 48
                 $replacements->put($this->configClass()->startSeparator() .
49 49
                     $key . $this->configClass()->endSeparator(), $value);
50 50
             });
Please login to merge, or discard this patch.