Skip to content

Commit

Permalink
Coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Jun 5, 2024
1 parent ac9bedd commit fb89c9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = [
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit fb89c9a

Please sign in to comment.