Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TMP] IBX-8534: Dropped deprecated context and getIndexData from Storage #190

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"ext-pdo": "*",
"ext-xsl": "*",
"ibexa/content-forms": "~5.0.x-dev",
"ibexa/core": "~5.0.x-dev",
"ibexa/core": "dev-ibx-8534-core-v5-p1 as 5.0.x-dev",
"ibexa/http-cache": "~5.0.x-dev",
"ibexa/rest": "~5.0.x-dev",
"symfony/asset": "^5.1",
Expand Down
30 changes: 0 additions & 30 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,6 @@ parameters:
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Method Ibexa\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorage\\:\\:deleteFieldData\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Method Ibexa\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorage\\:\\:deleteFieldData\\(\\) has parameter \\$fieldIds with no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -435,26 +430,6 @@ parameters:
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Method Ibexa\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorage\\:\\:getFieldData\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Method Ibexa\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorage\\:\\:getIndexData\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Method Ibexa\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorage\\:\\:getIndexData\\(\\) should return array\\<Ibexa\\\\Contracts\\\\Core\\\\Search\\\\Field\\> but return statement is missing\\.$#"
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Method Ibexa\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorage\\:\\:storeFieldData\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/lib/FieldType/RichText/RichTextStorage.php

-
message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: ''\\|'ezremote\\://', 2\\?\\: string, 3\\?\\: string\\}\\.$#"
count: 1
Expand Down Expand Up @@ -1705,11 +1680,6 @@ parameters:
count: 1
path: tests/lib/FieldType/RichText/Gateway/DoctrineStorageTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorageTest\\:\\:getContext\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: tests/lib/FieldType/RichText/RichTextStorageTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\FieldTypeRichText\\\\FieldType\\\\RichText\\\\RichTextStorageTest\\:\\:groupLinksData\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
14 changes: 3 additions & 11 deletions src/lib/FieldType/RichText/RichTextStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(StorageGateway $gateway, LoggerInterface $logger = n
/**
* @see \Ibexa\Contracts\Core\FieldType\FieldStorage
*/
public function storeFieldData(VersionInfo $versionInfo, Field $field, array $context)
public function storeFieldData(VersionInfo $versionInfo, Field $field)
{
$document = new DOMDocument();
$document->loadXML($field->value->data);
Expand Down Expand Up @@ -128,12 +128,8 @@ public function storeFieldData(VersionInfo $versionInfo, Field $field, array $co

/**
* Modifies $field if needed, using external data (like for Urls).
*
* @param \Ibexa\Contracts\Core\Persistence\Content\VersionInfo $versionInfo
* @param \Ibexa\Contracts\Core\Persistence\Content\Field $field
* @param array $context
*/
public function getFieldData(VersionInfo $versionInfo, Field $field, array $context)
public function getFieldData(VersionInfo $versionInfo, Field $field)
{
$document = new DOMDocument();
$document->loadXML($field->value->data);
Expand Down Expand Up @@ -186,7 +182,7 @@ public function getFieldData(VersionInfo $versionInfo, Field $field, array $cont
$field->value->data = $document->saveXML();
}

public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds, array $context)
public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds)
{
foreach ($fieldIds as $fieldId) {
$this->gateway->unlinkUrl($fieldId, $versionInfo->versionNo);
Expand All @@ -202,8 +198,4 @@ public function hasFieldData()
{
return true;
}

public function getIndexData(VersionInfo $versionInfo, Field $field, array $context)
{
}
}
20 changes: 4 additions & 16 deletions tests/lib/FieldType/RichText/RichTextStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public function testGetFieldData($xmlString, $updatedXmlString, $linkIds, $linkU
$storage = $this->getPartlyMockedStorage($gateway);
$storage->getFieldData(
$versionInfo,
$field,
$this->getContext()
$field
);

self::assertEquals(
Expand Down Expand Up @@ -238,8 +237,7 @@ public function testStoreFieldData(
$storage = $this->getPartlyMockedStorage($gateway);
$result = $storage->storeFieldData(
$versionInfo,
$field,
$this->getContext()
$field
);

self::assertEquals(
Expand Down Expand Up @@ -345,8 +343,7 @@ public function testStoreFieldDataThrowsNotFoundException(
$storage = $this->getPartlyMockedStorage($gateway);
$storage->storeFieldData(
$versionInfo,
$field,
$this->getContext()
$field
);
}

Expand All @@ -366,8 +363,7 @@ public function testDeleteFieldData(): void

$storage->deleteFieldData(
$versionInfo,
$fieldIds,
$this->getContext()
$fieldIds
);
}

Expand All @@ -389,14 +385,6 @@ protected function getPartlyMockedStorage(StorageGateway $gateway)
->getMock();
}

/**
* @return array
*/
protected function getContext()
{
return ['context'];
}

/**
* @var \Psr\Log\LoggerInterface|\PHPUnit\Framework\MockObject\MockObject
*/
Expand Down
Loading