diff --git a/Definition/PropertyDefinition.php b/Definition/PropertyDefinition.php index 36a9a714..adcfd55b 100644 --- a/Definition/PropertyDefinition.php +++ b/Definition/PropertyDefinition.php @@ -285,22 +285,34 @@ 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."); } 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 +}