From c12f48b84bdfd9b5720e8588bd0e1d144c29323b Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Mon, 3 Jul 2023 07:50:52 +0300 Subject: [PATCH] hm why would i need attributes? --- src/math/Matrix.php | 12 ++++-------- src/nbt/tag/Compound.php | 12 ++++-------- src/nbt/tag/EnumTag.php | 15 +++++---------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/math/Matrix.php b/src/math/Matrix.php index d3030874..a110517d 100644 --- a/src/math/Matrix.php +++ b/src/math/Matrix.php @@ -21,23 +21,19 @@ class Matrix implements ArrayAccess{ } } - #[\ReturnTypeWillChange] - public function offsetExists($offset){ + public function offsetExists(mixed $offset): mixed{ return isset($this->matrix[(int) $offset]); } - #[\ReturnTypeWillChange] - public function offsetGet($offset){ + public function offsetGet(mixed $offset): mixed{ return $this->matrix[(int) $offset]; } - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value){ + public function offsetSet(mixed $offset, mixed $value): mixed{ $this->matrix[(int) $offset] = $value; } - #[\ReturnTypeWillChange] - public function offsetUnset($offset){ + public function offsetUnset(mixed $offset): mixed{ unset($this->matrix[(int) $offset]); } diff --git a/src/nbt/tag/Compound.php b/src/nbt/tag/Compound.php index a8f99aaf..13050f01 100644 --- a/src/nbt/tag/Compound.php +++ b/src/nbt/tag/Compound.php @@ -28,13 +28,11 @@ class Compound extends NamedTag implements \ArrayAccess{ } } - #[\ReturnTypeWillChange] - public function offsetExists($offset){ + public function offsetExists(mixed $offset): mixed{ return isset($this->{$offset}); } - #[\ReturnTypeWillChange] - public function offsetGet($offset){ + public function offsetGet(mixed $offset): mixed{ if($this->{$offset} instanceof Tag){ if($this->{$offset} instanceof \ArrayAccess){ return $this->{$offset}; @@ -46,8 +44,7 @@ class Compound extends NamedTag implements \ArrayAccess{ return null; } - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value){ + public function offsetSet(mixed $offset, mixed $value): mixed{ if($value instanceof Tag){ $this->{$offset} = $value; }elseif(isset($this->{$offset}) and $this->{$offset} instanceof Tag){ @@ -55,8 +52,7 @@ class Compound extends NamedTag implements \ArrayAccess{ } } - #[\ReturnTypeWillChange] - public function offsetUnset($offset){ + public function offsetUnset(mixed $offset): mixed{ unset($this->{$offset}); } diff --git a/src/nbt/tag/EnumTag.php b/src/nbt/tag/EnumTag.php index 4c1810ff..41aa8c45 100644 --- a/src/nbt/tag/EnumTag.php +++ b/src/nbt/tag/EnumTag.php @@ -40,13 +40,11 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{ return $value; } - #[\ReturnTypeWillChange] - public function offsetExists($offset){ + public function offsetExists(mixed $offset): mixed{ return isset($this->{$offset}); } - #[\ReturnTypeWillChange] - public function offsetGet($offset){ + public function offsetGet(mixed $offset): mixed{ if($this->{$offset} instanceof Tag){ if($this->{$offset} instanceof \ArrayAccess){ return $this->{$offset}; @@ -58,8 +56,7 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{ return null; } - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value){ + public function offsetSet(mixed $offset, mixed $value): mixed{ if($value instanceof Tag){ $this->{$offset} = $value; }elseif($this->{$offset} instanceof Tag){ @@ -67,13 +64,11 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{ } } - #[\ReturnTypeWillChange] - public function offsetUnset($offset){ + public function offsetUnset(mixed $offset): mixed{ unset($this->{$offset}); } - #[\ReturnTypeWillChange] - public function count($mode = COUNT_NORMAL){ + public function count(mixed $mode = COUNT_NORMAL): mixed{ for($i = 0; true; $i++){ if(!isset($this->{$i})){ return $i;