mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
hm why would i need attributes?
This commit is contained in:
parent
332252bacb
commit
c12f48b84b
3 changed files with 13 additions and 26 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue