@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function handle() |
43 | 43 | { |
44 | - DB::transaction(function () { |
|
44 | + DB::transaction(function() { |
|
45 | 45 | $class = $this->getModelArgument(); |
46 | 46 | |
47 | 47 | $models = ($class)::all(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $modelsToUpdate = $models->where($columnName, null); |
58 | 58 | |
59 | - $modelsToUpdate->each(function ($model) use ($columnName) { |
|
59 | + $modelsToUpdate->each(function($model) use ($columnName) { |
|
60 | 60 | $model->withoutSequencing()->update([ |
61 | 61 | $columnName => $model->getNextSequenceValue(), |
62 | 62 | ]); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function handle() |
43 | 43 | { |
44 | - DB::transaction(function () { |
|
44 | + DB::transaction(function() { |
|
45 | 45 | $class = $this->getModelArgument(); |
46 | 46 | |
47 | 47 | $models = ($class)::all(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $modelsToUpdate = $models->where($columnName, '!=', null); |
58 | 58 | |
59 | - $modelsToUpdate->each(function ($model) use ($columnName) { |
|
59 | + $modelsToUpdate->each(function($model) use ($columnName) { |
|
60 | 60 | $model->withoutSequencing()->update([ |
61 | 61 | $columnName => null, |
62 | 62 | ]); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $class = $this->argument('model'); |
17 | 17 | |
18 | - if (! class_exists($class)) { |
|
18 | + if (!class_exists($class)) { |
|
19 | 19 | $message = "Class `{$class}` not found."; |
20 | 20 | |
21 | 21 | $this->error($message); |
@@ -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(); |