From 8c23cbc99d54c458c84bb0fa6fc5a14d3e3d32f7 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:01:01 +0700 Subject: [PATCH 1/2] chore: rector run --- .../src/QueryBuilderAdapter.php | 6 +++--- .../src/QueryBuilderAdapter.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php b/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php index 5ad6d3d..b648967 100644 --- a/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php +++ b/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php @@ -128,7 +128,7 @@ private function getQueryBuilder( foreach ($parameters as $template => $parameter) { /** - * @psalm-suppress PossiblyInvalidArgument + * @psalm-suppress PossiblyInvalidArgument */ $queryBuilder->setParameter( $template, @@ -412,7 +412,7 @@ private function doCount( * @psalm-suppress RedundantCondition * @phpstan-ignore-next-line */ - if (\is_callable([$queryBuilder, 'resetQueryPart'])) { + if (\is_callable($queryBuilder->resetQueryPart(...))) { return $this->doCountWithSubquery($queryBuilder); } @@ -447,7 +447,7 @@ private function doCountWithSubquery(QueryBuilder $queryBuilder): int $sql = $queryBuilder->getSQL(); // @phpstan-ignore function.alreadyNarrowedType - if (\is_callable([$queryBuilder, 'resetQueryPart'])) { + if (\is_callable($queryBuilder->resetQueryPart(...))) { // @phpstan-ignore-next-line $queryBuilder->resetQueryPart('from'); } diff --git a/packages/rekapager-doctrine-orm-adapter/src/QueryBuilderAdapter.php b/packages/rekapager-doctrine-orm-adapter/src/QueryBuilderAdapter.php index 083470b..aa02283 100644 --- a/packages/rekapager-doctrine-orm-adapter/src/QueryBuilderAdapter.php +++ b/packages/rekapager-doctrine-orm-adapter/src/QueryBuilderAdapter.php @@ -166,7 +166,7 @@ private function getQueryBuilder( } /** - * @psalm-suppress PossiblyInvalidArgument + * @psalm-suppress PossiblyInvalidArgument */ $queryBuilder->setParameter( $template, From 852ed093b5bb753f86982181c09b58c6fa53be0b Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:06:10 +0700 Subject: [PATCH 2/2] static analysis fix --- .../src/QueryBuilderAdapter.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php b/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php index b648967..bd9dcad 100644 --- a/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php +++ b/packages/rekapager-doctrine-dbal-adapter/src/QueryBuilderAdapter.php @@ -411,6 +411,7 @@ private function doCount( /** * @psalm-suppress RedundantCondition * @phpstan-ignore-next-line + * @psalm-suppress UndefinedMethod */ if (\is_callable($queryBuilder->resetQueryPart(...))) { return $this->doCountWithSubquery($queryBuilder); @@ -446,9 +447,15 @@ private function doCountWithSubquery(QueryBuilder $queryBuilder): int $queryBuilder = (clone $queryBuilder); $sql = $queryBuilder->getSQL(); - // @phpstan-ignore function.alreadyNarrowedType + /** + * @psalm-suppress UndefinedMethod + * @phpstan-ignore function.alreadyNarrowedType + */ if (\is_callable($queryBuilder->resetQueryPart(...))) { - // @phpstan-ignore-next-line + /** + * @psalm-suppress DeprecatedMethod + * @phpstan-ignore-next-line + */ $queryBuilder->resetQueryPart('from'); }