@@ -27,11 +27,11 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | }); |
@@ -44,7 +44,7 @@ |
||
| 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 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 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 |
||
| 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) . |
@@ -40,7 +40,7 @@ |
||
| 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 | |
@@ -56,7 +56,7 @@ |
||
| 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 | |
@@ -49,7 +49,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | }); |
@@ -180,8 +180,7 @@ |
||
| 180 | 180 | protected function hasFile($option, $pathFunction, $prefix = '') |
| 181 | 181 | { |
| 182 | 182 | return (bool)($this->options->has($prefix . $option) ? |
| 183 | - $this->options->get($prefix . $option) : |
|
| 184 | - $this->laravel['files']->exists($this->$pathFunction($prefix))); |
|
| 183 | + $this->options->get($prefix . $option) : $this->laravel['files']->exists($this->$pathFunction($prefix))); |
|
| 185 | 184 | } |
| 186 | 185 | |
| 187 | 186 | /** |
@@ -44,7 +44,7 @@ |
||
| 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 | }); |
@@ -104,7 +104,7 @@ discard block |
||
| 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 | } |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | protected function createDirectory(Module $module, $directory) |
| 123 | 123 | { |
| 124 | - if( file_exists(base_path().DIRECTORY_SEPARATOR.$directory)){ |
|
| 124 | + if (file_exists(base_path() . DIRECTORY_SEPARATOR . $directory)) { |
|
| 125 | 125 | return true; |
| 126 | - }else{ |
|
| 126 | + } else { |
|
| 127 | 127 | $result = |
| 128 | 128 | $this->laravel['files']->makeDirectory($module->directory() . |
| 129 | 129 | DIRECTORY_SEPARATOR . $directory, 0755, true); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $replacements = $subModule ? ['class' => $subModule] : []; |
| 166 | 166 | |
| 167 | - $files->each(function ($stubFile, $moduleFile) use ($module, $stubGroup, $replacements) { |
|
| 167 | + $files->each(function($stubFile, $moduleFile) use ($module, $stubGroup, $replacements) { |
|
| 168 | 168 | $this->copyStubFileIntoModule($module, $stubFile, $stubGroup, |
| 169 | 169 | $moduleFile, $replacements); |
| 170 | 170 | }); |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | $destinationFile, |
| 236 | 236 | array $replacements = [] |
| 237 | 237 | ) { |
| 238 | - if(file_exists(base_path().DIRECTORY_SEPARATOR.dirname($destinationFile))){ |
|
| 238 | + if (file_exists(base_path() . DIRECTORY_SEPARATOR . dirname($destinationFile))) { |
|
| 239 | 239 | $result = $this->laravel['files']->put($destinationFile, |
| 240 | 240 | $this->replace($this->laravel['files']->get($sourceFile), $module, |
| 241 | 241 | $replacements) |
| 242 | 242 | ); |
| 243 | - }else{ |
|
| 243 | + } else { |
|
| 244 | 244 | $result = $this->laravel['files']->put($module->directory() . |
| 245 | 245 | DIRECTORY_SEPARATOR . $destinationFile, |
| 246 | 246 | $this->replace($this->laravel['files']->get($sourceFile), $module, |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | { |
| 124 | 124 | if( file_exists(base_path().DIRECTORY_SEPARATOR.$directory)){ |
| 125 | 125 | return true; |
| 126 | - }else{ |
|
| 126 | + } else{ |
|
| 127 | 127 | $result = |
| 128 | 128 | $this->laravel['files']->makeDirectory($module->directory() . |
| 129 | 129 | DIRECTORY_SEPARATOR . $directory, 0755, true); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $this->replace($this->laravel['files']->get($sourceFile), $module, |
| 241 | 241 | $replacements) |
| 242 | 242 | ); |
| 243 | - }else{ |
|
| 243 | + } else{ |
|
| 244 | 244 | $result = $this->laravel['files']->put($module->directory() . |
| 245 | 245 | DIRECTORY_SEPARATOR . $destinationFile, |
| 246 | 246 | $this->replace($this->laravel['files']->get($sourceFile), $module, |