mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
more php 8.x compatibility
This commit is contained in:
parent
2fc163af5a
commit
9d78a3b5cf
@ -174,6 +174,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
* @return OTS_Monster Monster.
|
||||
* @throws DOMException On DOM operation error.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
return $this->getMonster( key($this->monsters) );
|
||||
@ -187,7 +188,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
/**
|
||||
* Moves to next iterator monster.
|
||||
*/
|
||||
public function next()
|
||||
public function next(): void
|
||||
{
|
||||
next($this->monsters);
|
||||
}
|
||||
@ -197,6 +198,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
*
|
||||
* @return string Current position key.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return key($this->monsters);
|
||||
@ -207,7 +209,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
*
|
||||
* @return bool If iterator has anything more.
|
||||
*/
|
||||
public function valid()
|
||||
public function valid(): bool
|
||||
{
|
||||
return key($this->monsters) !== null;
|
||||
}
|
||||
@ -215,7 +217,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
/**
|
||||
* Resets iterator index.
|
||||
*/
|
||||
public function rewind()
|
||||
public function rewind(): void
|
||||
{
|
||||
reset($this->monsters);
|
||||
}
|
||||
@ -226,6 +228,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
* @param string $offset Array key.
|
||||
* @return bool True if it's set.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->monsters[$offset]);
|
||||
@ -239,6 +242,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
* @return OTS_Monster Monster instance.
|
||||
* @throws DOMException On DOM operation error.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->getMonster($offset);
|
||||
@ -251,6 +255,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
* @param mixed $value Field value.
|
||||
* @throws E_OTS_ReadOnly Always - this class is read-only.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
throw new E_OTS_ReadOnly();
|
||||
@ -262,6 +267,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
* @param string|int $offset Array key.
|
||||
* @throws E_OTS_ReadOnly Always - this class is read-only.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
throw new E_OTS_ReadOnly();
|
||||
|
@ -308,7 +308,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
|
||||
* @since 0.1.5
|
||||
* @return AppendIterator Iterator for all spells.
|
||||
*/
|
||||
public function getIterator()
|
||||
public function getIterator(): Traversable
|
||||
{
|
||||
$iterator = new AppendIterator();
|
||||
$iterator->append( new ArrayIterator($this->runes) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user