@@ -41,37 +41,37 @@ |
||
| 41 | 41 | |
| 42 | 42 | protected function setUpDatabase() |
| 43 | 43 | { |
| 44 | - $this->app['db']->connection()->getSchemaBuilder()->create('dummies', function (Blueprint $table) { |
|
| 44 | + $this->app['db']->connection()->getSchemaBuilder()->create('dummies', function(Blueprint $table) { |
|
| 45 | 45 | $table->increments('id'); |
| 46 | 46 | $table->string('name'); |
| 47 | 47 | $table->integer('order_column'); |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - collect(range(1, 20))->each(function (int $i) { |
|
| 50 | + collect(range(1, 20))->each(function(int $i) { |
|
| 51 | 51 | Dummy::create(['name' => $i]); |
| 52 | 52 | }); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | protected function setUpSoftDeletes() |
| 56 | 56 | { |
| 57 | - $this->app['db']->connection()->getSchemaBuilder()->table('dummies', function (Blueprint $table) { |
|
| 57 | + $this->app['db']->connection()->getSchemaBuilder()->table('dummies', function(Blueprint $table) { |
|
| 58 | 58 | $table->softDeletes(); |
| 59 | 59 | }); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | protected function setUpGroupColumn() |
| 63 | 63 | { |
| 64 | - $this->app['db']->connection()->getSchemaBuilder()->table('dummies', function (Blueprint $table) { |
|
| 64 | + $this->app['db']->connection()->getSchemaBuilder()->table('dummies', function(Blueprint $table) { |
|
| 65 | 65 | $table->integer('group_column')->nullable(); |
| 66 | 66 | }); |
| 67 | 67 | |
| 68 | 68 | Dummy::truncate(); |
| 69 | 69 | |
| 70 | - collect(range(1, 20))->each(function (int $i) { |
|
| 70 | + collect(range(1, 20))->each(function(int $i) { |
|
| 71 | 71 | DummyWithGroupColumn::create(['name' => $i, 'group_column' => 1]); |
| 72 | 72 | }); |
| 73 | 73 | |
| 74 | - collect(range(1, 20))->each(function (int $i) { |
|
| 74 | + collect(range(1, 20))->each(function(int $i) { |
|
| 75 | 75 | DummyWithGroupColumn::create(['name' => $i, 'group_column' => 2]); |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | public static function bootSortableTrait() |
| 13 | 13 | { |
| 14 | - static::creating(function ($model) { |
|
| 14 | + static::creating(function($model) { |
|
| 15 | 15 | if ($model instanceof Sortable && $model->shouldSortWhenCreating()) { |
| 16 | 16 | $model->setHighestOrderNumber(); |
| 17 | 17 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public static function setNewOrder($ids, int $startOrder = 1) |
| 62 | 62 | { |
| 63 | - if (! is_array($ids) && ! $ids instanceof ArrayAccess) { |
|
| 63 | + if (!is_array($ids) && !$ids instanceof ArrayAccess) { |
|
| 64 | 64 | throw new InvalidArgumentException('You must pass an array or ArrayAccess object to setNewOrder'); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | if ( |
| 85 | 85 | isset($this->sortable['order_column_name']) && |
| 86 | - ! empty($this->sortable['order_column_name']) |
|
| 86 | + !empty($this->sortable['order_column_name']) |
|
| 87 | 87 | ) { |
| 88 | 88 | return $this->sortable['order_column_name']; |
| 89 | 89 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | if ( |
| 100 | 100 | isset($this->sortable['group_column_name']) && |
| 101 | - ! empty($this->sortable['group_column_name']) |
|
| 101 | + !empty($this->sortable['group_column_name']) |
|
| 102 | 102 | ) { |
| 103 | 103 | return $this->sortable['group_column_name']; |
| 104 | 104 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | ->where($orderColumnName, '>', $this->$orderColumnName) |
| 146 | 146 | ->first(); |
| 147 | 147 | |
| 148 | - if (! $swapWithModel) { |
|
| 148 | + if (!$swapWithModel) { |
|
| 149 | 149 | return $this; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | ->where($orderColumnName, '<', $this->$orderColumnName) |
| 167 | 167 | ->first(); |
| 168 | 168 | |
| 169 | - if (! $swapWithModel) { |
|
| 169 | + if (!$swapWithModel) { |
|
| 170 | 170 | return $this; |
| 171 | 171 | } |
| 172 | 172 | |