Passed
Branch master (a3ea7a)
by Gustavo
03:24
created
Category
src/Console/Commands/PopulateSequenceValues.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                 ]);
Please login to merge, or discard this patch.
src/Console/Commands/FlushSequenceValues.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                 ]);
Please login to merge, or discard this patch.
src/Console/Commands/Traits/HasModelArgument.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Traits/Sequenceable.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.