From fb89c9a48335c2e5bff63ea5b181bb4af54ab271 Mon Sep 17 00:00:00 2001 From: Nattfarinn Date: Wed, 5 Jun 2024 09:27:48 +0200 Subject: [PATCH] Coding standards --- phpstan-baseline.neon | 7 ++++++- .../Mapper/ResolveVirtualFieldSubscriberTest.php | 16 ++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9e4814e81a..cc284c088d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10990,6 +10990,11 @@ parameters: count: 1 path: src/lib/IO/IOService.php + - + message: "#^Parameter \\#2 \\$length of function fread expects int\\<1, max\\>, int\\<0, max\\> given\\.$#" + count: 1 + path: src/lib/IO/IOService.php + - message: "#^Property Ibexa\\\\Contracts\\\\Core\\\\IO\\\\BinaryFile\\:\\:\\$uri \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 2 @@ -51946,7 +51951,7 @@ parameters: path: tests/lib/Persistence/Legacy/Content/MapperTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\MapperTest\\:\\:getLanguageHandler\\(\\) should return Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Language\\\\Handler but returns Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Language\\\\Handler\\.$#" + message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\MapperTest\\:\\:getLanguageHandler\\(\\) should return Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\Language\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Language\\\\Handler\\.$#" count: 1 path: tests/lib/Persistence/Legacy/Content/MapperTest.php diff --git a/tests/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriberTest.php b/tests/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriberTest.php index 38beb6aaa7..90d22e8f3d 100644 --- a/tests/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriberTest.php +++ b/tests/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriberTest.php @@ -33,7 +33,7 @@ public function testResolveVirtualField(): void $converterRegistry = $this->getConverterRegistry(); $contentGateway = $this->createMock(ContentGateway::class); - $contentGateway->expects($this->never())->method('insertNewField'); + $contentGateway->expects(self::never())->method('insertNewField'); $storageRegistry = $this->createMock(StorageRegistry::class); $storageRegistry->method('getStorage')->willReturn(new NullStorage()); @@ -83,7 +83,7 @@ public function testResolveVirtualExternalStorageField(): void $converterRegistry = $this->getConverterRegistry(); $contentGateway = $this->createMock(ContentGateway::class); - $contentGateway->expects($this->never())->method('insertNewField'); + $contentGateway->expects(self::never())->method('insertNewField'); $defaultFieldStorageMock = $this->createMock(DefaultDataFieldStorage::class); $defaultFieldStorageMock @@ -144,9 +144,9 @@ public function testPersistEmptyExternalStorageField(): void $converterRegistry = $this->getConverterRegistry(); $storage = $this->createMock(FieldStorage::class); - $storage->expects($this->never())->method('storeFieldData'); + $storage->expects(self::never())->method('storeFieldData'); - $storage->expects($this->once()) + $storage->expects(self::once()) ->method('getFieldData') ->willReturnCallback(static function (VersionInfo $versionInfo, Field $field) { $field->value->externalData = [ @@ -158,7 +158,7 @@ public function testPersistEmptyExternalStorageField(): void $storageRegistry->method('getStorage')->willReturn($storage); $contentGateway = $this->createMock(ContentGateway::class); - $contentGateway->expects($this->once())->method('insertNewField') + $contentGateway->expects(self::once())->method('insertNewField') ->willReturn(567); $eventDispatcher = $this->getEventDispatcher( @@ -210,19 +210,19 @@ public function testPersistExternalStorageField(): void $converterRegistry = $this->getConverterRegistry(); $storage = $this->createMock(FieldStorage::class); - $storage->expects($this->once()) + $storage->expects(self::once()) ->method('storeFieldData') ->willReturnCallback(static function (VersionInfo $versionInfo, Field $field) { $field->value->externalData = $field->value->data; }); - $storage->expects($this->once())->method('getFieldData'); + $storage->expects(self::once())->method('getFieldData'); $storageRegistry = $this->createMock(StorageRegistry::class); $storageRegistry->method('getStorage')->willReturn($storage); $contentGateway = $this->createMock(ContentGateway::class); - $contentGateway->expects($this->once())->method('insertNewField') + $contentGateway->expects(self::once())->method('insertNewField') ->willReturn(456); $eventDispatcher = $this->getEventDispatcher(