From c45ae9dc90375e9c70a20df51e35f8a6c92e2275 Mon Sep 17 00:00:00 2001 From: Bhanu <8525040+bhanu951@users.noreply.github.com> Date: Fri, 12 Aug 2022 12:03:36 +0530 Subject: [PATCH 1/3] Update PropertyDefinition.php --- Definition/PropertyDefinition.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Definition/PropertyDefinition.php b/Definition/PropertyDefinition.php index 36a9a714..25824140 100644 --- a/Definition/PropertyDefinition.php +++ b/Definition/PropertyDefinition.php @@ -285,22 +285,33 @@ public function loadLazyProperties() { } } - public function offsetExists($offset) { + /** + * {@inheritdoc} + */ + public function offsetExists(mixed $offset): bool { dump($this); throw new \Exception("Accessing definition $this->name as array with offsetExists $offset."); } - public function offsetGet($offset) { + /** + * {@inheritdoc} + */ + public function offsetGet(mixed $offset): mixed { dump($this); throw new \Exception("Accessing definition $this->name as array with offsetGet $offset."); } - public function offsetSet($offset, $value) { + /** + * {@inheritdoc} + */ + public function offsetSet(mixed $offset, mixed $value): void { dump($this); throw new \Exception("Accessing definition $this->name as array with offsetSet $offset."); } - public function offsetUnset($offset){ + /** + * {@inheritdoc} + */ public function offsetUnset(mixed $offset): void{ dump($this); throw new \Exception("Accessing definition $this->name as array with offsetUnset $offset."); } From 1dc58d62664ed6c15a77d1c91dad545bffa3eb67 Mon Sep 17 00:00:00 2001 From: Bhanu <8525040+bhanu951@users.noreply.github.com> Date: Fri, 12 Aug 2022 12:15:45 +0530 Subject: [PATCH 2/3] Update PropertyDefinition.php --- Definition/PropertyDefinition.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Definition/PropertyDefinition.php b/Definition/PropertyDefinition.php index 25824140..adcfd55b 100644 --- a/Definition/PropertyDefinition.php +++ b/Definition/PropertyDefinition.php @@ -311,7 +311,8 @@ public function offsetSet(mixed $offset, mixed $value): void { /** * {@inheritdoc} - */ public function offsetUnset(mixed $offset): void{ + */ + public function offsetUnset(mixed $offset): void { dump($this); throw new \Exception("Accessing definition $this->name as array with offsetUnset $offset."); } From 406acfddf1c538f8ccdc37ca7401edeefbc50629 Mon Sep 17 00:00:00 2001 From: Bhanu <8525040+bhanu951@users.noreply.github.com> Date: Fri, 12 Aug 2022 12:17:29 +0530 Subject: [PATCH 3/3] Update DataItemArrayAccessTrait.php --- .../Data/DataItemArrayAccessTrait.php | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/MutableTypedData/Data/DataItemArrayAccessTrait.php b/MutableTypedData/Data/DataItemArrayAccessTrait.php index c33e43f5..1f4cfbc4 100644 --- a/MutableTypedData/Data/DataItemArrayAccessTrait.php +++ b/MutableTypedData/Data/DataItemArrayAccessTrait.php @@ -10,11 +10,17 @@ */ trait DataItemArrayAccessTrait { - public function offsetExists($offset) { + /** + * {@inheritdoc} + */ + public function offsetExists(mixed $offset): bool { return isset($this->value[$offset]); } - public function offsetGet($offset) { + /** + * {@inheritdoc} + */ + public function offsetGet(mixed $offset): mixed { if (!isset($this->properties[$offset])) { throw new \Exception(sprintf("No property %s at address %s. Valid properties are: %s.", $offset, @@ -44,7 +50,10 @@ public function offsetGet($offset) { } } - public function offsetSet($offset, $value) { + /** + * {@inheritdoc} + */ + public function offsetSet(mixed $offset, mixed $value): void { throw new \Exception(sprintf( "Attempt to set array key %s at %s.", $offset, @@ -52,7 +61,10 @@ public function offsetSet($offset, $value) { )); } - public function offsetUnset($offset) { + /** + * {@inheritdoc} + */ + public function offsetUnset(mixed $offset): void { throw new \Exception(sprintf( "Attempt to unset array key %s at %s.", $offset, @@ -60,4 +72,4 @@ public function offsetUnset($offset) { )); } -} \ No newline at end of file +}