From 8409c1c0515f159f4bbb0bdb731e6c728354f893 Mon Sep 17 00:00:00 2001 From: "a.shamavov" Date: Mon, 3 Mar 2025 11:21:20 +0500 Subject: [PATCH] =?UTF-8?q?style:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=B8=D0=BB=D0=B5?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Filter/DateRange.php | 2 +- src/Filter/In.php | 2 +- tests/Entity/Post.php | 2 +- tests/FilterByRangeTest.php | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Filter/DateRange.php b/src/Filter/DateRange.php index 6fef58c..9acd75f 100644 --- a/src/Filter/DateRange.php +++ b/src/Filter/DateRange.php @@ -12,7 +12,7 @@ final class DateRange extends HttpFilter public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { $queryBuilder->where( - 'strftime(\'%Y-%m-%d\', ' . $this->getColumn() . ') >= \'' . $this->getHttpValue()['from'] . '\' AND ' . + 'strftime(\'%Y-%m-%d\', ' . $this->getColumn() . ') >= \'' . $this->getHttpValue()['from'] . '\' AND ' . 'strftime(\'%Y-%m-%d\', ' . $this->getColumn() . ') <= \'' . $this->getHttpValue()['to'] . '\'', ); diff --git a/src/Filter/In.php b/src/Filter/In.php index 5618b82..59f00fb 100644 --- a/src/Filter/In.php +++ b/src/Filter/In.php @@ -11,7 +11,7 @@ final class In extends HttpFilter { public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder { - $values = array_map(fn ($value) => '\'' . $value . '\'', $this->getHttpValue()); + $values = array_map(fn($value) => '\'' . $value . '\'', $this->getHttpValue()); $stringValues = implode(',', $values); $queryBuilder->where( diff --git a/tests/Entity/Post.php b/tests/Entity/Post.php index 50c2c0e..112b13e 100644 --- a/tests/Entity/Post.php +++ b/tests/Entity/Post.php @@ -44,7 +44,7 @@ class Post ?bool $moderated, ?\DateTimeImmutable $createdAt, ?\DateTimeImmutable $updatedAt = null, - ?int $countOfViews = null + ?int $countOfViews = null, ) { $this->title = $title; $this->content = $content; diff --git a/tests/FilterByRangeTest.php b/tests/FilterByRangeTest.php index 4ac9fb7..e89d0f1 100644 --- a/tests/FilterByRangeTest.php +++ b/tests/FilterByRangeTest.php @@ -26,7 +26,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $countOfViews + countOfViews: $countOfViews, ); $post2 = new Post( @@ -70,7 +70,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $firstCountOfViews + countOfViews: $firstCountOfViews, ); $post2 = new Post( @@ -78,7 +78,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $secondCountOfViews + countOfViews: $secondCountOfViews, ); $this->em->persist($post); @@ -115,7 +115,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $firstCountOfViews + countOfViews: $firstCountOfViews, ); $post2 = new Post( @@ -123,7 +123,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $secondCountOfViews + countOfViews: $secondCountOfViews, ); $this->em->persist($post); @@ -160,7 +160,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $firstCountOfViews + countOfViews: $firstCountOfViews, ); $post2 = new Post( @@ -168,7 +168,7 @@ class FilterByRangeTest extends TestCase $this->faker->text(), $this->faker->boolean(), DateTimeImmutable::createFromInterface($this->faker->dateTime()), - countOfViews: $secondCountOfViews + countOfViews: $secondCountOfViews, ); $this->em->persist($post); -- GitLab