From 5142bb7aee2d06111e990df000c31677eac06815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 22 Sep 2026 14:53:57 +0200 Subject: [PATCH 1/2] IBX-12654: Added ibexa/phpstan to the PHPStan configuration --- composer.json | 1 + phpstan.neon | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 40fd56c..1ddf3dd 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "dama/doctrine-test-bundle": "^8.2", "deptrac/deptrac": "^4.7", "ibexa/code-style": "~2.0.0", + "ibexa/phpstan": "~6.0.x-dev", "ibexa/rector": "~6.0.x-dev", "ibexa/test-core": "~6.0.x-dev", "phpstan/phpstan": "^2.0", diff --git a/phpstan.neon b/phpstan.neon index 23ad920..ea755d6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,7 @@ includes: - - phpstan-baseline.neon - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/ibexa/phpstan/extension.neon + - phpstan-baseline.neon parameters: level: 8 From 74b75592edf32b4249013ddf7fafb9d47576c687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 22 Sep 2026 14:55:25 +0200 Subject: [PATCH 2/2] IBX-12654: Fixed dynamic calls to static methods --- tests/bundle/Gateway/DoctrineSchemaMetadataTest.php | 2 +- tests/bundle/Gateway/ExpressionVisitorTest.php | 2 +- tests/lib/Gateway/DoInsertIdentifierTest.php | 2 +- tests/lib/Gateway/RelationshipTypeStrategyRegistryTest.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/bundle/Gateway/DoctrineSchemaMetadataTest.php b/tests/bundle/Gateway/DoctrineSchemaMetadataTest.php index 549fe4f..d57d5e3 100644 --- a/tests/bundle/Gateway/DoctrineSchemaMetadataTest.php +++ b/tests/bundle/Gateway/DoctrineSchemaMetadataTest.php @@ -21,7 +21,7 @@ final class DoctrineSchemaMetadataTest extends TestCase protected function setUp(): void { $this->metadata = new DoctrineSchemaMetadata( - $this->createStub(Connection::class), + self::createStub(Connection::class), 'stdClass', 'std_class_table', [ diff --git a/tests/bundle/Gateway/ExpressionVisitorTest.php b/tests/bundle/Gateway/ExpressionVisitorTest.php index 16a3ee5..c6d7ef5 100644 --- a/tests/bundle/Gateway/ExpressionVisitorTest.php +++ b/tests/bundle/Gateway/ExpressionVisitorTest.php @@ -156,7 +156,7 @@ public function testFieldNotFound(): void public function testFieldFromMissingRelationship(): void { /** @var \Exception $exception */ - $exception = $this->createStub(RuntimeMappingExceptionInterface::class); + $exception = self::createStub(RuntimeMappingExceptionInterface::class); $this->schemaMetadata ->expects(self::once()) ->method('getRelationshipByForeignProperty') diff --git a/tests/lib/Gateway/DoInsertIdentifierTest.php b/tests/lib/Gateway/DoInsertIdentifierTest.php index dda851c..69fb6f9 100644 --- a/tests/lib/Gateway/DoInsertIdentifierTest.php +++ b/tests/lib/Gateway/DoInsertIdentifierTest.php @@ -71,7 +71,7 @@ private function createGateway(array $identifierColumns): IdentifierProbeGateway { return new IdentifierProbeGateway( $this->connection, - $this->createStub(DoctrineSchemaMetadataRegistryInterface::class), + self::createStub(DoctrineSchemaMetadataRegistryInterface::class), $identifierColumns, ); } diff --git a/tests/lib/Gateway/RelationshipTypeStrategyRegistryTest.php b/tests/lib/Gateway/RelationshipTypeStrategyRegistryTest.php index 41d9424..b8380fe 100644 --- a/tests/lib/Gateway/RelationshipTypeStrategyRegistryTest.php +++ b/tests/lib/Gateway/RelationshipTypeStrategyRegistryTest.php @@ -32,7 +32,7 @@ public function testHandleRelationshipTypeThrowsRuntimeMappingException(): void $this->expectExceptionMessage('Unhandled relationship metadata. Expected one of "Ibexa\Contracts\CorePersistence\Gateway\DoctrineRelationship", "Ibexa\Contracts\CorePersistence\Gateway\DoctrineOneToManyRelationship". Received "Ibexa\Tests\CorePersistence\Stub\InvalidDoctrineRelationship"'); $this->registry->handleRelationshipType( - new QueryBuilder($this->createStub(Connection::class)), + new QueryBuilder(self::createStub(Connection::class)), new InvalidDoctrineRelationship(), 'root_table_alias', 'from_table', @@ -47,7 +47,7 @@ public function testHandleRelationshipTypeQueryThrowsRuntimeMappingException(): $this->registry->handleRelationshipTypeQuery( new InvalidDoctrineRelationship(), - $this->createStub(QueryBuilder::class), + self::createStub(QueryBuilder::class), 'related_class_id_column', 'related_class_id_column_0' );