diff --git a/src/Query/ArrayProxyQuery.php b/src/Query/ArrayProxyQuery.php index 8c4444ff..ba9308ee 100644 --- a/src/Query/ArrayProxyQuery.php +++ b/src/Query/ArrayProxyQuery.php @@ -39,9 +39,9 @@ public function sort(SortingData $sortingData): void $valueB = $propertyAccessor->getValue($b, $propertyPath); if ($valueA < $valueB) { - return $direction === 'asc' ? -1 : 1; + return 'asc' === $direction ? -1 : 1; } elseif ($valueA > $valueB) { - return $direction === 'asc' ? 1 : -1; + return 'asc' === $direction ? 1 : -1; } } @@ -68,4 +68,4 @@ public function getResult(): ResultSetInterface totalItemCount: $this->totalItemCount, ); } -} \ No newline at end of file +} diff --git a/src/Resources/config/core.php b/src/Resources/config/core.php index a88676b6..c63bf211 100755 --- a/src/Resources/config/core.php +++ b/src/Resources/config/core.php @@ -74,7 +74,6 @@ ->tag('kreyu_data_table.proxy_query.factory') ; - $services ->set('kreyu_data_table.proxy_query.factory.doctrine_orm', DoctrineOrmProxyQueryFactory::class) ->tag('kreyu_data_table.proxy_query.factory') diff --git a/tests/Unit/Query/ArrayProxyQueryFactoryTest.php b/tests/Unit/Query/ArrayProxyQueryFactoryTest.php index ec3f3723..288aa1bc 100644 --- a/tests/Unit/Query/ArrayProxyQueryFactoryTest.php +++ b/tests/Unit/Query/ArrayProxyQueryFactoryTest.php @@ -36,6 +36,6 @@ public static function provideSupportsCases(): iterable yield 'integer' => [123, false]; yield 'bool' => [true, false]; yield 'null' => [null, false]; - yield 'object' => [new \stdClass, false]; + yield 'object' => [new \stdClass(), false]; } } diff --git a/tests/Unit/Query/ArrayProxyQueryTest.php b/tests/Unit/Query/ArrayProxyQueryTest.php index 43ebdcda..440f93f0 100644 --- a/tests/Unit/Query/ArrayProxyQueryTest.php +++ b/tests/Unit/Query/ArrayProxyQueryTest.php @@ -100,4 +100,4 @@ public function testSortAndPaginate() $this->assertEquals(1, $result->getCurrentPageItemCount()); $this->assertEquals(3, $result->getTotalItemCount()); } -} \ No newline at end of file +}