@@ -196,7 +196,7 @@ |
||
| 196 | 196 | /** |
| 197 | 197 | * check column exist in table. |
| 198 | 198 | * |
| 199 | - * @param $column |
|
| 199 | + * @param string $column |
|
| 200 | 200 | * |
| 201 | 201 | * @return bool |
| 202 | 202 | */ |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | class BaseModel extends Model implements BaseModelEventObserverable, Transformable |
| 13 | 13 | { |
| 14 | - use BaseModelEventsTrait,TransformableTrait; |
|
| 14 | + use BaseModelEventsTrait, TransformableTrait; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Indicates if the model should be auto set user_id. |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $ip = smart_get_client_ip(); |
| 102 | 102 | |
| 103 | - if (! $this->isDirty(static::UPDATED_IP) && $this->hasTableColumn(static::UPDATED_IP)) { |
|
| 103 | + if (!$this->isDirty(static::UPDATED_IP) && $this->hasTableColumn(static::UPDATED_IP)) { |
|
| 104 | 104 | $this->{static::UPDATED_IP} = $ip; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if (! $this->exists && ! $this->isDirty(static::CREATED_IP) && $this->hasTableColumn(static::CREATED_IP)) { |
|
| 107 | + if (!$this->exists && !$this->isDirty(static::CREATED_IP) && $this->hasTableColumn(static::CREATED_IP)) { |
|
| 108 | 108 | $this->{static::CREATED_IP} = $ip; |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | protected function updateUsers() |
| 128 | 128 | { |
| 129 | 129 | $user_id = $this->getAuthUserId(); |
| 130 | - if (! ($user_id > 0)) { |
|
| 130 | + if (!($user_id > 0)) { |
|
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if (! $this->isDirty(static::UPDATED_BY) && $this->hasTableColumn(static::UPDATED_BY)) { |
|
| 134 | + if (!$this->isDirty(static::UPDATED_BY) && $this->hasTableColumn(static::UPDATED_BY)) { |
|
| 135 | 135 | $this->{static::UPDATED_BY} = $user_id; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - if (! $this->exists && ! $this->isDirty(static::CREATED_BY) && $this->hasTableColumn(static::CREATED_BY)) { |
|
| 138 | + if (!$this->exists && !$this->isDirty(static::CREATED_BY) && $this->hasTableColumn(static::CREATED_BY)) { |
|
| 139 | 139 | $this->{static::CREATED_BY} = $user_id; |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | /** |
| 187 | 187 | * Retrieve first data of repository with fail if not found. |
| 188 | 188 | * |
| 189 | - * @param array $columns |
|
| 189 | + * @param string[] $columns |
|
| 190 | 190 | * |
| 191 | 191 | * @return mixed |
| 192 | 192 | */ |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | * |
| 360 | 360 | * @param array $where |
| 361 | 361 | * |
| 362 | - * @return int |
|
| 362 | + * @return null|boolean |
|
| 363 | 363 | */ |
| 364 | 364 | public function forceDeleteWhere(array $where) |
| 365 | 365 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function validateCreate(array $attributes) |
| 36 | 36 | { |
| 37 | - if (! is_null($this->validator)) { |
|
| 37 | + if (!is_null($this->validator)) { |
|
| 38 | 38 | $this->validator->with($attributes)->passesOrFail(ValidatorInterface::RULE_CREATE); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function validateUpdate(array $attributes) |
| 46 | 46 | { |
| 47 | - if (! is_null($this->validator)) { |
|
| 47 | + if (!is_null($this->validator)) { |
|
| 48 | 48 | $this->validator->with($attributes)->passesOrFail(ValidatorInterface::RULE_UPDATE); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | public function makeModel() |
| 94 | 94 | { |
| 95 | 95 | $model = $this->relateModel ? $this->relation() : $this->app->make($this->model()); |
| 96 | - if (! ($model instanceof Model || $model instanceof Relation)) { |
|
| 96 | + if (!($model instanceof Model || $model instanceof Relation)) { |
|
| 97 | 97 | throw new RepositoryException('Class '.get_class($model).' must be an instance of Illuminate\\Database\\Eloquent\\Model'); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($model instanceof BaseModelEventObserverable) { |
| 101 | - $model->setRepository($this); //set repository |
|
| 101 | + $model->setRepository($this); //set repository |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | return $this->model = $model; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Execute the command. |
| 37 | 37 | * |
| 38 | - * @return void |
|
| 38 | + * @return null|false |
|
| 39 | 39 | */ |
| 40 | 40 | public function fire() |
| 41 | 41 | { |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | 'force' => $this->option('force'), |
| 46 | 46 | ]); |
| 47 | 47 | // generate repository service provider |
| 48 | - if (! file_exists($bindingGenerator->getPath())) { |
|
| 48 | + if (!file_exists($bindingGenerator->getPath())) { |
|
| 49 | 49 | $this->call('make:provider', [ |
| 50 | 50 | 'name' => $bindingGenerator->getConfigGeneratorClassPath($bindingGenerator->getPathConfigNode()), |
| 51 | 51 | ]); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | * Execute the command. |
| 47 | 47 | * |
| 48 | - * @return void |
|
| 48 | + * @return null|false |
|
| 49 | 49 | */ |
| 50 | 50 | public function fire() |
| 51 | 51 | { |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | /** |
| 176 | 176 | * Get class-specific output paths. |
| 177 | 177 | * |
| 178 | - * @param $class |
|
| 178 | + * @param string $class |
|
| 179 | 179 | * |
| 180 | 180 | * @return string |
| 181 | 181 | */ |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $path = config('repository.generator.stubsOverridePath', __DIR__); |
| 75 | 75 | |
| 76 | - if (! file_exists($path.'/Stubs/'.$this->stub.'.stub')) { |
|
| 76 | + if (!file_exists($path.'/Stubs/'.$this->stub.'.stub')) { |
|
| 77 | 77 | $path = __DIR__; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -266,10 +266,10 @@ discard block |
||
| 266 | 266 | public function run() |
| 267 | 267 | { |
| 268 | 268 | $this->setUp(); |
| 269 | - if ($this->filesystem->exists($path = $this->getPath()) && ! $this->force) { |
|
| 269 | + if ($this->filesystem->exists($path = $this->getPath()) && !$this->force) { |
|
| 270 | 270 | throw new FileAlreadyExistsException($path); |
| 271 | 271 | } |
| 272 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 272 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 273 | 273 | $this->filesystem->makeDirectory($dir, 0777, true, true); |
| 274 | 274 | } |
| 275 | 275 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function getOption($key, $default = null) |
| 310 | 310 | { |
| 311 | - if (! $this->hasOption($key)) { |
|
| 311 | + if (!$this->hasOption($key)) { |
|
| 312 | 312 | return $default; |
| 313 | 313 | } |
| 314 | 314 | |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | /** |
| 99 | 99 | * Get stub templates. |
| 100 | 100 | * |
| 101 | - * @return string |
|
| 101 | + * @return Stub |
|
| 102 | 102 | */ |
| 103 | 103 | public function getStub() |
| 104 | 104 | { |
@@ -141,11 +141,11 @@ |
||
| 141 | 141 | } |
| 142 | 142 | $path = config('repository.generator.stubsOverridePath', __DIR__); |
| 143 | 143 | |
| 144 | - if (! file_exists($path."/Stubs/migration/{$file}.stub")) { |
|
| 144 | + if (!file_exists($path."/Stubs/migration/{$file}.stub")) { |
|
| 145 | 145 | $path = __DIR__; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if (! file_exists($path."/Stubs/migration/{$file}.stub")) { |
|
| 148 | + if (!file_exists($path."/Stubs/migration/{$file}.stub")) { |
|
| 149 | 149 | throw new FileNotFoundException($path."/Stubs/migration/{$file}.stub"); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | /** |
| 99 | 99 | * Get matches data from regex. |
| 100 | 100 | * |
| 101 | - * @return array |
|
| 101 | + * @return string[] |
|
| 102 | 102 | */ |
| 103 | 103 | public function getMatches() |
| 104 | 104 | { |
@@ -36,6 +36,7 @@ |
||
| 36 | 36 | /** |
| 37 | 37 | * Get stub template for generated file. |
| 38 | 38 | * |
| 39 | + * @param string $stub |
|
| 39 | 40 | * @return string |
| 40 | 41 | */ |
| 41 | 42 | public function getStub($stub = null) |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $stub = isset($stub) ? $stub : $this->stub; |
| 44 | 44 | $path = config('repository.generator.stubsOverridePath', __DIR__); |
| 45 | 45 | |
| 46 | - if (! file_exists($path.'/Stubs/'.$stub.'.stub')) { |
|
| 46 | + if (!file_exists($path.'/Stubs/'.$stub.'.stub')) { |
|
| 47 | 47 | $path = __DIR__; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | /** |
| 108 | 108 | * Get stub contents. |
| 109 | 109 | * |
| 110 | - * @return mixed|string |
|
| 110 | + * @return string |
|
| 111 | 111 | */ |
| 112 | 112 | public function getContents() |
| 113 | 113 | { |