@@ -24,15 +24,15 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public static function bootSequenceable(): void |
| 26 | 26 | { |
| 27 | - static::creating(function ($model) { |
|
| 27 | + static::creating(function($model) { |
|
| 28 | 28 | $model->handleSequenceableCreate(); |
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | - static::updating(function ($model) { |
|
| 31 | + static::updating(function($model) { |
|
| 32 | 32 | $model->handleSequenceableUpdate(); |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - static::deleting(function ($model) { |
|
| 35 | + static::deleting(function($model) { |
|
| 36 | 36 | $model->handleSequenceableDelete(); |
| 37 | 37 | }); |
| 38 | 38 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if (! $this->shouldBeSequenced) { |
|
| 93 | + if (!$this->shouldBeSequenced) { |
|
| 94 | 94 | $this->shouldBeSequenced = true; |
| 95 | 95 | |
| 96 | 96 | return; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if (! $this->shouldBeSequenced) { |
|
| 127 | + if (!$this->shouldBeSequenced) { |
|
| 128 | 128 | $this->shouldBeSequenced = true; |
| 129 | 129 | |
| 130 | 130 | return; |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $originalValue = $this->getOriginalSequenceValue(); |
| 174 | 174 | |
| 175 | 175 | return $newValue < static::getInitialSequenceValue() |
| 176 | - || ! is_null($originalValue) && $newValue > $this->getLastSequenceValue() |
|
| 176 | + || !is_null($originalValue) && $newValue > $this->getLastSequenceValue() |
|
| 177 | 177 | || is_null($originalValue) && $newValue > $this->getNextSequenceValue(); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | protected static function decrementSequenceValues(Collection $models): void |
| 188 | 188 | { |
| 189 | - $models->each(function ($model) { |
|
| 189 | + $models->each(function($model) { |
|
| 190 | 190 | $model->decrement(static::getSequenceColumnName()); |
| 191 | 191 | }); |
| 192 | 192 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | protected static function incrementSequenceValues(Collection $models): void |
| 202 | 202 | { |
| 203 | - $models->each(function ($model) { |
|
| 203 | + $models->each(function($model) { |
|
| 204 | 204 | $model->increment(static::getSequenceColumnName()); |
| 205 | 205 | }); |
| 206 | 206 | } |
@@ -238,10 +238,10 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | protected static function updateSequenceablesAffectedBy(Model $model): void |
| 240 | 240 | { |
| 241 | - $model->getConnection()->transaction(function () use ($model) { |
|
| 241 | + $model->getConnection()->transaction(function() use ($model) { |
|
| 242 | 242 | $modelsToUpdate = $model->getSequence() |
| 243 | 243 | ->where('id', '!=', $model->id) |
| 244 | - ->filter(function ($sequenceModel) use ($model) { |
|
| 244 | + ->filter(function($sequenceModel) use ($model) { |
|
| 245 | 245 | return $sequenceModel->isAffectedByRepositioningOf($model); |
| 246 | 246 | }) |
| 247 | 247 | ->each->withoutSequencing(); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | $originalValue = $this->getOriginalSequenceValue(); |
| 265 | 265 | |
| 266 | - return ! is_null($originalValue) && $originalValue < $this->getSequenceValue(); |
|
| 266 | + return !is_null($originalValue) && $originalValue < $this->getSequenceValue(); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | { |
| 276 | 276 | $originalValue = $this->getOriginalSequenceValue(); |
| 277 | 277 | |
| 278 | - return ! is_null($originalValue) && $originalValue > $this->getSequenceValue(); |
|
| 278 | + return !is_null($originalValue) && $originalValue > $this->getSequenceValue(); |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |