diff --git a/src/SortableTrait.php b/src/SortableTrait.php index f5c73dd..fc15668 100644 --- a/src/SortableTrait.php +++ b/src/SortableTrait.php @@ -46,7 +46,7 @@ public static function setNewOrder($ids, int $startOrder = 1, string $primaryKey throw new InvalidArgumentException('You must pass an array or ArrayAccess object to setNewOrder'); } - $model = new static; + $model = new static(); $orderColumnName = $model->determineOrderColumnName(); diff --git a/tests/SortableTest.php b/tests/SortableTest.php index 9a2c5c6..159b71f 100644 --- a/tests/SortableTest.php +++ b/tests/SortableTest.php @@ -157,7 +157,7 @@ public function it_will_determine_to_sort_when_creating_if_sortable_attribute_do /** @test */ public function it_will_determine_to_sort_when_creating_if_sort_when_creating_setting_does_not_exist() { - $model = new class extends Dummy { + $model = new class () extends Dummy { public $sortable = []; }; @@ -167,13 +167,13 @@ public function it_will_determine_to_sort_when_creating_if_sort_when_creating_se /** @test */ public function it_will_respect_the_sort_when_creating_setting() { - $model = new class extends Dummy { + $model = new class () extends Dummy { public $sortable = ['sort_when_creating' => true]; }; $this->assertTrue($model->shouldSortWhenCreating()); - $model = new class extends Dummy { + $model = new class () extends Dummy { public $sortable = ['sort_when_creating' => false]; }; $this->assertFalse($model->shouldSortWhenCreating()); @@ -334,7 +334,7 @@ public function it_can_use_config_properties() 'eloquent-sortable.sort_when_creating' => true, ]); - $model = new class extends Dummy { + $model = new class () extends Dummy { public $sortable = []; }; @@ -345,7 +345,7 @@ public function it_can_use_config_properties() /** @test */ public function it_can_override_config_properties() { - $model = new class extends Dummy { + $model = new class () extends Dummy { public $sortable = [ 'order_column_name' => 'my_custom_order_column', 'sort_when_creating' => false,