-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Remove
PropertyCollectionInterface
and make `PropertyCollecti…
…on` not array like resolves #4464
- Loading branch information
Showing
13 changed files
with
77 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,11 @@ | |
|
||
/** | ||
* The property collection implementation | ||
* @internal | ||
* | ||
* @extends \IteratorAggregate<string,mixed> | ||
* @api | ||
*/ | ||
final class PropertyCollection implements PropertyCollectionInterface | ||
final class PropertyCollection implements \IteratorAggregate | ||
Check failure on line 26 in Neos.ContentRepository.Core/Classes/Projection/ContentGraph/PropertyCollection.php GitHub Actions / PHP 8.2 Test linting-unit-functionaltests-mysql (deps: highest)
Check failure on line 26 in Neos.ContentRepository.Core/Classes/Projection/ContentGraph/PropertyCollection.php GitHub Actions / PHP 8.2 Test linting-unit-functionaltests-mysql (deps: highest)
|
||
{ | ||
/** | ||
* Properties from Nodes | ||
|
@@ -46,33 +48,23 @@ public function __construct( | |
$this->propertyConverter = $propertyConverter; | ||
} | ||
|
||
public function offsetExists($offset): bool | ||
public function has(string $propertyName): bool | ||
{ | ||
return $this->serializedPropertyValues->propertyExists($offset); | ||
return $this->serializedPropertyValues->propertyExists($propertyName); | ||
} | ||
|
||
public function offsetGet($offset): mixed | ||
public function get(string $propertyName): mixed | ||
{ | ||
if (!isset($this->deserializedPropertyValuesRuntimeCache[$offset])) { | ||
$serializedProperty = $this->serializedPropertyValues->getProperty($offset); | ||
if (!isset($this->deserializedPropertyValuesRuntimeCache[$propertyName])) { | ||
$serializedProperty = $this->serializedPropertyValues->getProperty($propertyName); | ||
if ($serializedProperty === null) { | ||
return null; | ||
} | ||
$this->deserializedPropertyValuesRuntimeCache[$offset] = | ||
$this->deserializedPropertyValuesRuntimeCache[$propertyName] = | ||
$this->propertyConverter->deserializePropertyValue($serializedProperty); | ||
} | ||
|
||
return $this->deserializedPropertyValuesRuntimeCache[$offset]; | ||
} | ||
|
||
public function offsetSet($offset, $value): never | ||
{ | ||
throw new \RuntimeException("Do not use!"); | ||
} | ||
|
||
public function offsetUnset($offset): never | ||
{ | ||
throw new \RuntimeException("Do not use!"); | ||
return $this->deserializedPropertyValuesRuntimeCache[$propertyName]; | ||
} | ||
|
||
/** | ||
|
@@ -81,7 +73,7 @@ public function offsetUnset($offset): never | |
public function getIterator(): \Generator | ||
{ | ||
foreach ($this->serializedPropertyValues as $propertyName => $_) { | ||
yield $propertyName => $this->offsetGet($propertyName); | ||
yield $propertyName => $this->get($propertyName); | ||
} | ||
} | ||
|
||
|
31 changes: 0 additions & 31 deletions
31
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/PropertyCollectionInterface.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.