hm why would i need attributes?

This commit is contained in:
GameHerobrine 2023-07-03 07:50:52 +03:00
parent 332252bacb
commit c12f48b84b
3 changed files with 13 additions and 26 deletions

View file

@ -21,23 +21,19 @@ class Matrix implements ArrayAccess{
} }
} }
#[\ReturnTypeWillChange] public function offsetExists(mixed $offset): mixed{
public function offsetExists($offset){
return isset($this->matrix[(int) $offset]); return isset($this->matrix[(int) $offset]);
} }
#[\ReturnTypeWillChange] public function offsetGet(mixed $offset): mixed{
public function offsetGet($offset){
return $this->matrix[(int) $offset]; return $this->matrix[(int) $offset];
} }
#[\ReturnTypeWillChange] public function offsetSet(mixed $offset, mixed $value): mixed{
public function offsetSet($offset, $value){
$this->matrix[(int) $offset] = $value; $this->matrix[(int) $offset] = $value;
} }
#[\ReturnTypeWillChange] public function offsetUnset(mixed $offset): mixed{
public function offsetUnset($offset){
unset($this->matrix[(int) $offset]); unset($this->matrix[(int) $offset]);
} }

View file

@ -28,13 +28,11 @@ class Compound extends NamedTag implements \ArrayAccess{
} }
} }
#[\ReturnTypeWillChange] public function offsetExists(mixed $offset): mixed{
public function offsetExists($offset){
return isset($this->{$offset}); return isset($this->{$offset});
} }
#[\ReturnTypeWillChange] public function offsetGet(mixed $offset): mixed{
public function offsetGet($offset){
if($this->{$offset} instanceof Tag){ if($this->{$offset} instanceof Tag){
if($this->{$offset} instanceof \ArrayAccess){ if($this->{$offset} instanceof \ArrayAccess){
return $this->{$offset}; return $this->{$offset};
@ -46,8 +44,7 @@ class Compound extends NamedTag implements \ArrayAccess{
return null; return null;
} }
#[\ReturnTypeWillChange] public function offsetSet(mixed $offset, mixed $value): mixed{
public function offsetSet($offset, $value){
if($value instanceof Tag){ if($value instanceof Tag){
$this->{$offset} = $value; $this->{$offset} = $value;
}elseif(isset($this->{$offset}) and $this->{$offset} instanceof Tag){ }elseif(isset($this->{$offset}) and $this->{$offset} instanceof Tag){
@ -55,8 +52,7 @@ class Compound extends NamedTag implements \ArrayAccess{
} }
} }
#[\ReturnTypeWillChange] public function offsetUnset(mixed $offset): mixed{
public function offsetUnset($offset){
unset($this->{$offset}); unset($this->{$offset});
} }

View file

@ -40,13 +40,11 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{
return $value; return $value;
} }
#[\ReturnTypeWillChange] public function offsetExists(mixed $offset): mixed{
public function offsetExists($offset){
return isset($this->{$offset}); return isset($this->{$offset});
} }
#[\ReturnTypeWillChange] public function offsetGet(mixed $offset): mixed{
public function offsetGet($offset){
if($this->{$offset} instanceof Tag){ if($this->{$offset} instanceof Tag){
if($this->{$offset} instanceof \ArrayAccess){ if($this->{$offset} instanceof \ArrayAccess){
return $this->{$offset}; return $this->{$offset};
@ -58,8 +56,7 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{
return null; return null;
} }
#[\ReturnTypeWillChange] public function offsetSet(mixed $offset, mixed $value): mixed{
public function offsetSet($offset, $value){
if($value instanceof Tag){ if($value instanceof Tag){
$this->{$offset} = $value; $this->{$offset} = $value;
}elseif($this->{$offset} instanceof Tag){ }elseif($this->{$offset} instanceof Tag){
@ -67,13 +64,11 @@ class EnumTag extends NamedTag implements \ArrayAccess, \Countable{
} }
} }
#[\ReturnTypeWillChange] public function offsetUnset(mixed $offset): mixed{
public function offsetUnset($offset){
unset($this->{$offset}); unset($this->{$offset});
} }
#[\ReturnTypeWillChange] public function count(mixed $mode = COUNT_NORMAL): mixed{
public function count($mode = COUNT_NORMAL){
for($i = 0; true; $i++){ for($i = 0; true; $i++){
if(!isset($this->{$i})){ if(!isset($this->{$i})){
return $i; return $i;