From 8181acb00750d66b9e534aa1596dc1875ca1b67d Mon Sep 17 00:00:00 2001 From: James Etu Date: Tue, 19 Mar 2024 12:34:40 +0000 Subject: [PATCH] Return 'static' instead of 'self' in static returning methods Extending classes need to return itself --- src/ResultIterator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ResultIterator.php b/src/ResultIterator.php index 595c37a3..bea9dd26 100644 --- a/src/ResultIterator.php +++ b/src/ResultIterator.php @@ -81,7 +81,7 @@ final private function __construct() * @param mixed[] $parameters * @param class-string|null $className */ - public static function createResultIterator(QueryFactory $queryFactory, array $parameters, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, int $mode, LoggerInterface $logger): self + public static function createResultIterator(QueryFactory $queryFactory, array $parameters, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, int $mode, LoggerInterface $logger): static { $iterator = new static(); if ($mode !== TDBMService::MODE_CURSOR && $mode !== TDBMService::MODE_ARRAY) { @@ -99,7 +99,7 @@ public static function createResultIterator(QueryFactory $queryFactory, array $p return $iterator; } - public static function createEmpyIterator(): self + public static function createEmpyIterator(): static { $iterator = new static(); $iterator->totalCount = 0;