@@ -55,8 +55,8 @@ discard block |
||
| 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 |
||
| 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); |
@@ -135,7 +135,7 @@ discard block |
||
| 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 | } |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | public function getPackageName() |
| 240 | 240 | { |
| 241 | 241 | if (is_null($this->version)) { |
| 242 | - return $this->name . ':dev-master'; |
|
| 242 | + return $this->name.':dev-master'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - return $this->name . ':' . $this->version; |
|
| 245 | + return $this->name.':'.$this->version; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @param Application $app |
| 37 | 37 | * @param $name |
| 38 | - * @param $path |
|
| 38 | + * @param string $path |
|
| 39 | 39 | */ |
| 40 | 40 | public function __construct(Application $app, $name, $path) |
| 41 | 41 | { |
@@ -169,6 +169,7 @@ discard block |
||
| 169 | 169 | /** |
| 170 | 170 | * Get json contents. |
| 171 | 171 | * |
| 172 | + * @param string $file |
|
| 172 | 173 | * @return Json |
| 173 | 174 | */ |
| 174 | 175 | public function json($file = null) |
@@ -196,7 +197,7 @@ discard block |
||
| 196 | 197 | /** |
| 197 | 198 | * Get a specific data from composer.json file by given the key. |
| 198 | 199 | * |
| 199 | - * @param $key |
|
| 200 | + * @param string $key |
|
| 200 | 201 | * @param null $default |
| 201 | 202 | * |
| 202 | 203 | * @return mixed |
@@ -274,7 +275,7 @@ discard block |
||
| 274 | 275 | /** |
| 275 | 276 | * Determine whether the given status same with the current module status. |
| 276 | 277 | * |
| 277 | - * @param $status |
|
| 278 | + * @param integer $status |
|
| 278 | 279 | * |
| 279 | 280 | * @return bool |
| 280 | 281 | */ |
@@ -326,9 +327,9 @@ discard block |
||
| 326 | 327 | /** |
| 327 | 328 | * Set active state for current module. |
| 328 | 329 | * |
| 329 | - * @param $active |
|
| 330 | + * @param integer $active |
|
| 330 | 331 | * |
| 331 | - * @return bool |
|
| 332 | + * @return integer |
|
| 332 | 333 | */ |
| 333 | 334 | public function setActive($active) |
| 334 | 335 | { |
@@ -338,7 +339,7 @@ discard block |
||
| 338 | 339 | /** |
| 339 | 340 | * Disable the current module. |
| 340 | 341 | * |
| 341 | - * @return bool |
|
| 342 | + * @return boolean|null |
|
| 342 | 343 | */ |
| 343 | 344 | public function disable() |
| 344 | 345 | { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | 'stubs' => [ |
| 26 | 26 | 'enabled' => false, |
| 27 | - 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', |
|
| 27 | + 'path' => base_path().'/vendor/nwidart/laravel-modules/src/Commands/stubs', |
|
| 28 | 28 | 'files' => [ |
| 29 | 29 | 'start' => 'start.php', |
| 30 | 30 | 'routes' => 'Http/routes.php', |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | foreach (array_reverse($this->laravel['modules']->all()) as $module) { |
| 45 | - $this->line('Running for module: <info>' . $module->getName() . '</info>'); |
|
| 45 | + $this->line('Running for module: <info>'.$module->getName().'</info>'); |
|
| 46 | 46 | |
| 47 | 47 | $this->reset($module); |
| 48 | 48 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | foreach (array_reverse($this->laravel['modules']->all()) as $module) { |
| 45 | - $this->line('Running for module: <info>' . $module->getName() . '</info>'); |
|
| 45 | + $this->line('Running for module: <info>'.$module->getName().'</info>'); |
|
| 46 | 46 | |
| 47 | 47 | $this->reset($module); |
| 48 | 48 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | $controllerPath = $this->laravel['modules']->config('paths.generator.controller'); |
| 45 | 45 | |
| 46 | - return $path . $controllerPath . '/' . $this->getControllerName() . '.php'; |
|
| 46 | + return $path.$controllerPath.'/'.$this->getControllerName().'.php'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -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 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function createField($column, $attributes, $type = 'add') |
| 145 | 145 | { |
| 146 | - $results = "\t\t\t" . '$table'; |
|
| 146 | + $results = "\t\t\t".'$table'; |
|
| 147 | 147 | |
| 148 | 148 | foreach ($attributes as $key => $field) { |
| 149 | 149 | if (in_array($column, $this->relationshipKeys)) { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - return $results .= ';' . PHP_EOL; |
|
| 156 | + return $results .= ';'.PHP_EOL; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | protected function addRelationColumn($key, $field, $column) |
| 169 | 169 | { |
| 170 | - $relatedColumn = snake_case(class_basename($field)) . '_id'; |
|
| 170 | + $relatedColumn = snake_case(class_basename($field)).'_id'; |
|
| 171 | 171 | |
| 172 | 172 | $method = 'integer'; |
| 173 | 173 | |
@@ -186,18 +186,18 @@ discard block |
||
| 186 | 186 | protected function addColumn($key, $field, $column) |
| 187 | 187 | { |
| 188 | 188 | if ($this->hasCustomAttribute($column)) { |
| 189 | - return '->' . $field; |
|
| 189 | + return '->'.$field; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | if ($key == 0) { |
| 193 | - return '->' . $field . "('" . $column . "')"; |
|
| 193 | + return '->'.$field."('".$column."')"; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | if (str_contains($field, '(')) { |
| 197 | - return '->' . $field; |
|
| 197 | + return '->'.$field; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - return '->' . $field . '()'; |
|
| 200 | + return '->'.$field.'()'; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -212,10 +212,10 @@ discard block |
||
| 212 | 212 | protected function removeColumn($key, $field, $column) |
| 213 | 213 | { |
| 214 | 214 | if ($this->hasCustomAttribute($column)) { |
| 215 | - return '->' . $field; |
|
| 215 | + return '->'.$field; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - return '->dropColumn(' . "'" . $column . "')"; |
|
| 218 | + return '->dropColumn('."'".$column."')"; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public function getColumn($schema) |
| 229 | 229 | { |
| 230 | - return array_first(explode(':', $schema), function ($key, $value) { |
|
| 230 | + return array_first(explode(':', $schema), function($key, $value) { |
|
| 231 | 231 | return $value; |
| 232 | 232 | }); |
| 233 | 233 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | public function getAttributes($column, $schema) |
| 244 | 244 | { |
| 245 | - $fields = str_replace($column . ':', '', $schema); |
|
| 245 | + $fields = str_replace($column.':', '', $schema); |
|
| 246 | 246 | |
| 247 | 247 | return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields); |
| 248 | 248 | } |