From b112ced4b38f985f03f43d0f5dbcb8a1d55183d1 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 24 Jun 2026 15:43:09 +0200 Subject: [PATCH 1/6] [Tests] Dropped a call to `parent::supportsLikeWildcard` in children of `SearchBaseIntegrationTest` * Dropped a pointless call to `parent::supportsLikeWildcard` in children of `\Ibexa\Tests\Integration\Core\Repository\FieldType\SearchBaseIntegrationTest` Co-Authored-By: Vidar Langseid --- .../Repository/FieldType/DateAndTimeIntegrationTest.php | 7 +------ .../Core/Repository/FieldType/DateIntegrationTest.php | 7 +------ .../Core/Repository/FieldType/RelationIntegrationTest.php | 7 +------ .../Repository/FieldType/RelationListIntegrationTest.php | 7 +------ .../Core/Repository/FieldType/SelectionIntegrationTest.php | 4 +--- .../Core/Repository/FieldType/TimeIntegrationTest.php | 7 +------ 6 files changed, 6 insertions(+), 33 deletions(-) diff --git a/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php b/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php index 8b733ee841..b237f045e3 100644 --- a/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php @@ -30,13 +30,8 @@ public function getTypeName() return 'ezdatetime'; } - /** - * {@inheritdoc} - */ - protected function supportsLikeWildcard($value) + protected function supportsLikeWildcard($value): bool { - parent::supportsLikeWildcard($value); - return false; } diff --git a/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php b/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php index 2fc2508f44..105ffb1a86 100644 --- a/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php @@ -31,13 +31,8 @@ public function getTypeName() return 'ezdate'; } - /** - * {@inheritdoc} - */ - protected function supportsLikeWildcard($value) + protected function supportsLikeWildcard($value): bool { - parent::supportsLikeWildcard($value); - return false; } diff --git a/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php b/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php index a47546c4a7..bd7d90cbec 100644 --- a/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php @@ -33,13 +33,8 @@ public function getTypeName() return 'ezobjectrelation'; } - /** - * {@inheritdoc} - */ - protected function supportsLikeWildcard($value) + protected function supportsLikeWildcard($value): bool { - parent::supportsLikeWildcard($value); - return false; } diff --git a/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php b/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php index 6f9f861d1b..f10425a475 100644 --- a/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php @@ -33,13 +33,8 @@ public function getTypeName() return 'ezobjectrelationlist'; } - /** - * {@inheritdoc} - */ - protected function supportsLikeWildcard($value) + protected function supportsLikeWildcard($value): bool { - parent::supportsLikeWildcard($value); - return false; } diff --git a/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php b/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php index a8395a6f0b..e3445159fd 100644 --- a/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php @@ -34,10 +34,8 @@ public function getTypeName() * * If Selection is improved to be able to index + search for string also with LegacySearch, then adapt this too. */ - protected function supportsLikeWildcard($value) + protected function supportsLikeWildcard($value): bool { - parent::supportsLikeWildcard($value); - return false; } diff --git a/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php b/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php index 87132350bf..ec45506055 100644 --- a/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php @@ -29,13 +29,8 @@ public function getTypeName() return 'eztime'; } - /** - * {@inheritdoc} - */ - protected function supportsLikeWildcard($value) + protected function supportsLikeWildcard($value): bool { - parent::supportsLikeWildcard($value); - return false; } From 7713e25ddaf1ce355ae70e58155973d06b1480f8 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 24 Jun 2026 15:49:02 +0200 Subject: [PATCH 2/6] [Tests] Improved HostElementNormalizerTest * `$matcher->match()` performing side effects for the object instance also returns a result which can be assessed. * Fixed non-static call to static PHPUnit `assert*` methods * Added missing `@throws` annotation --- .../Serializer/HostElementNormalizerTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php index e409df5a27..f620b78337 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php @@ -17,6 +17,9 @@ final class HostElementNormalizerTest extends TestCase { + /** + * @throws \Symfony\Component\Serializer\Exception\ExceptionInterface + */ public function testNormalization(): void { $normalizer = new HostElementNormalizer(); @@ -25,9 +28,9 @@ public function testNormalization(): void $matcher = new HostElement(2); // Set request and invoke match to initialize HostElement::$hostElements $matcher->setRequest(SimplifiedRequest::fromUrl('http://ibexa.dev/foo/bar')); - $matcher->match(); + self::assertSame('dev', $matcher->match()); - $this->assertEquals( + self::assertEquals( [ 'elementNumber' => 2, 'hostElements' => [ @@ -43,8 +46,8 @@ public function testSupportsNormalization(): void { $normalizer = new HostElementNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(HostElement::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(HostElement::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } From ca3da69cbfac49fd91d0bd380e7801f56ab55c2b Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 24 Jun 2026 15:50:11 +0200 Subject: [PATCH 3/6] [Tests][PHPStan] Added `@phpstan-ignore new.resultUnused` to ContentTest * The purpose of the test is to check if constructor can be instantiated without errors, so this is expected behavior. Co-Authored-By: Vidar Langseid --- tests/lib/Repository/Service/Mock/ContentTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/Repository/Service/Mock/ContentTest.php b/tests/lib/Repository/Service/Mock/ContentTest.php index 339d23b203..bc7ceb4dfe 100644 --- a/tests/lib/Repository/Service/Mock/ContentTest.php +++ b/tests/lib/Repository/Service/Mock/ContentTest.php @@ -89,6 +89,7 @@ public function testConstructor(): void 'remove_archived_versions_on_publish' => true, ]; + /** @phpstan-ignore new.resultUnused */ new ContentService( $repositoryMock, $persistenceHandlerMock, From e050b4db010a8cb0376be9f4036f4da51ef6a3ad Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 24 Jun 2026 15:50:57 +0200 Subject: [PATCH 4/6] Fixed `HostElement::match` SiteAccess matcher implementation --- src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php index 3a1bbb4427..839dc2ffe6 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php @@ -57,7 +57,7 @@ public function match() { $elements = $this->getHostElements(); - return isset($elements[$this->elementNumber - 1]) ? $elements[$this->elementNumber - 1] : false; + return $elements[$this->elementNumber - 1] ?? false; } public function getName() From 446c04d2f084b588bcf7bbd1c972fd2f302f31bf Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 24 Jun 2026 15:51:14 +0200 Subject: [PATCH 5/6] [PHPStan] Removed resolved issues from the baseline Co-Authored-By: Vidar Langseid --- phpstan-baseline-lte-8.3.neon | 6 ------ phpstan-baseline.neon | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/phpstan-baseline-lte-8.3.neon b/phpstan-baseline-lte-8.3.neon index ab58eb7013..1ac105db1c 100644 --- a/phpstan-baseline-lte-8.3.neon +++ b/phpstan-baseline-lte-8.3.neon @@ -1,11 +1,5 @@ parameters: ignoreErrors: - - - message: '#^Call to new Ibexa\\Core\\Repository\\URLAliasService\(\) on a separate line has no effect\.$#' - identifier: new.resultUnused - count: 1 - path: tests/lib/Repository/Service/Mock/UrlAliasTest.php - - message: '#^Dead catch \- Ibexa\\Contracts\\Core\\Repository\\Exceptions\\NotFoundException is never thrown in the try block\.$#' identifier: catch.neverThrown diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4adced4037..8425c66ed4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -31239,7 +31239,7 @@ parameters: - message: '#^Offset ''scheme'' might not exist on array\{scheme\?\: string, host\: string, port\: int\<0, 65535\>, user\?\: string, pass\?\: string, path\?\: string, query\?\: string, fragment\?\: string\}\.$#' identifier: offsetAccess.notFound - count: 4 + count: 2 path: tests/bundle/Core/Routing/DefaultRouterTest.php - From 927eaa6c86374046999a98ebafa5e477c673508d Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 24 Jun 2026 16:03:05 +0200 Subject: [PATCH 6/6] [Tests][PHPStan] Added `@phpstan-ignore new.resultUnused` to UrlAliasTest * The purpose of the test is to check if constructor can be instantiated without errors, so this is expected behavior. Co-Authored-By: Vidar Langseid --- tests/lib/Repository/Service/Mock/UrlAliasTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/Repository/Service/Mock/UrlAliasTest.php b/tests/lib/Repository/Service/Mock/UrlAliasTest.php index cb06533ddb..21e5557c78 100644 --- a/tests/lib/Repository/Service/Mock/UrlAliasTest.php +++ b/tests/lib/Repository/Service/Mock/UrlAliasTest.php @@ -54,6 +54,7 @@ public function testConstructor() { $repositoryMock = $this->getRepositoryMock(); + /** @phpstan-ignore new.resultUnused */ new UrlALiasService( $repositoryMock, $this->urlAliasHandler,