@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $this->registerMigrations(); |
19 | 19 | |
20 | 20 | $this->publishes([ |
21 | - __DIR__ . '/../../database/migrations' => database_path('migrations'), |
|
21 | + __DIR__.'/../../database/migrations' => database_path('migrations'), |
|
22 | 22 | ], 'module-migrations'); |
23 | 23 | } |
24 | 24 | } |
@@ -33,6 +33,6 @@ discard block |
||
33 | 33 | |
34 | 34 | private function registerMigrations() |
35 | 35 | { |
36 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); |
|
36 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); |
|
37 | 37 | } |
38 | 38 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('modules', function (Blueprint $table) { |
|
16 | + Schema::create('modules', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->string('path'); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * Get a specific data from json file by given the key. |
91 | 91 | * |
92 | 92 | * @param string $key |
93 | - * @param null $default |
|
93 | + * @param string $default |
|
94 | 94 | * |
95 | 95 | * @return mixed |
96 | 96 | */ |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
191 | - * @return mixed|null |
|
191 | + * @return string |
|
192 | 192 | */ |
193 | 193 | public function getVersion() |
194 | 194 | { |
@@ -202,7 +202,7 @@ |
||
202 | 202 | { |
203 | 203 | |
204 | 204 | if (config('modules.database_management.update_file_to_database_when_updating')) { |
205 | - $json = Json::make($this->getPath() . '/' . 'module.json'); |
|
205 | + $json = Json::make($this->getPath().'/'.'module.json'); |
|
206 | 206 | $data = $json->getAttributes(); |
207 | 207 | |
208 | 208 | if (!isset($data['version'])) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function generate(): int |
30 | 30 | { |
31 | - return DB::transaction(function () { |
|
31 | + return DB::transaction(function() { |
|
32 | 32 | $name = $this->getName(); |
33 | 33 | |
34 | 34 | if ($this->module->has($name)) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function generateFiles() |
83 | 83 | { |
84 | 84 | foreach ($this->getFiles() as $stub => $file) { |
85 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
85 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
86 | 86 | |
87 | 87 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
88 | 88 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | if (GenerateConfigReader::read('provider')->generate() === true) { |
115 | 115 | Artisan::call('module:make-provider', [ |
116 | - 'name' => $moduleName . 'ServiceProvider', |
|
116 | + 'name' => $moduleName.'ServiceProvider', |
|
117 | 117 | 'module' => $moduleName, |
118 | 118 | '--master' => true, |
119 | 119 | ]); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if (GenerateConfigReader::read('controller')->generate() === true) { |
126 | 126 | $options = $this->type == 'api' ? ['--api' => true] : []; |
127 | 127 | Artisan::call('module:make-controller', [ |
128 | - 'controller' => $moduleName . 'Controller', |
|
128 | + 'controller' => $moduleName.'Controller', |
|
129 | 129 | 'module' => $moduleName, |
130 | 130 | ] + $options); |
131 | 131 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | private function generateModuleJsonFile() |
138 | 138 | { |
139 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
139 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
140 | 140 | |
141 | 141 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
142 | 142 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | /** |
72 | 72 | * Get module path for a specific module. |
73 | 73 | * |
74 | - * @param $name |
|
74 | + * @param string $name |
|
75 | 75 | * |
76 | 76 | * @return string |
77 | 77 | */ |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | { |
86 | 86 | $module = $this->find($name); |
87 | 87 | if ($module) { |
88 | - return $module->getPath() . '/'; |
|
88 | + return $module->getPath().'/'; |
|
89 | 89 | } |
90 | 90 | |
91 | - return $this->getPath() . '/' . Str::studly($name) . '/'; |
|
91 | + return $this->getPath().'/'.Str::studly($name).'/'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function getCached() |
140 | 140 | { |
141 | - return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
141 | + return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
142 | 142 | return $this->getModel()->all(); |
143 | 143 | }); |
144 | 144 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $allows = $this->getModel()->getFillable(); |
262 | 262 | } |
263 | 263 | |
264 | - return array_filter($attributes, function ($k) use ($allows) { |
|
264 | + return array_filter($attributes, function($k) use ($allows) { |
|
265 | 265 | return in_array($k, $allows); |
266 | 266 | }, ARRAY_FILTER_USE_KEY); |
267 | 267 | } |