mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 17:59:22 +02:00
PHP 8.1 compatibility
This commit is contained in:
parent
d691148c84
commit
0a3a079b86
@ -11,7 +11,7 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
$configForumTablePrefix = config('forum_table_prefix');
|
$configForumTablePrefix = config('forum_table_prefix');
|
||||||
if(!empty(trim($configForumTablePrefix))) {
|
if(null !== $configForumTablePrefix && !empty(trim($configForumTablePrefix))) {
|
||||||
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) {
|
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) {
|
||||||
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
|
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
|
||||||
}
|
}
|
||||||
|
@ -1019,6 +1019,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return Iterator List of players.
|
* @return Iterator List of players.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return $this->getPlayersList();
|
return $this->getPlayersList();
|
||||||
@ -1033,7 +1034,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return int Count of players.
|
* @return int Count of players.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return $this->getPlayersList()->count();
|
return $this->getPlayersList()->count();
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
|
|||||||
* @version 0.1.3
|
* @version 0.1.3
|
||||||
* @return OTS_Base_DAO Current row.
|
* @return OTS_Base_DAO Current row.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function current()
|
public function current()
|
||||||
{
|
{
|
||||||
$id = current($this->rows);
|
$id = current($this->rows);
|
||||||
@ -203,7 +204,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
|
|||||||
*
|
*
|
||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
*/
|
*/
|
||||||
public function rewind()
|
public function rewind(): void
|
||||||
{
|
{
|
||||||
$this->rows = $this->db->query( $this->getSQL() )->fetchAll();
|
$this->rows = $this->db->query( $this->getSQL() )->fetchAll();
|
||||||
}
|
}
|
||||||
@ -211,7 +212,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
|
|||||||
/**
|
/**
|
||||||
* Moves to next row.
|
* Moves to next row.
|
||||||
*/
|
*/
|
||||||
public function next()
|
public function next(): void
|
||||||
{
|
{
|
||||||
next($this->rows);
|
next($this->rows);
|
||||||
}
|
}
|
||||||
@ -221,6 +222,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
|
|||||||
*
|
*
|
||||||
* @return mixed Array key.
|
* @return mixed Array key.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function key()
|
public function key()
|
||||||
{
|
{
|
||||||
return key($this->rows);
|
return key($this->rows);
|
||||||
@ -231,7 +233,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
|
|||||||
*
|
*
|
||||||
* @return bool Does next row exist.
|
* @return bool Does next row exist.
|
||||||
*/
|
*/
|
||||||
public function valid()
|
public function valid(): bool
|
||||||
{
|
{
|
||||||
return key($this->rows) !== null;
|
return key($this->rows) !== null;
|
||||||
}
|
}
|
||||||
@ -243,7 +245,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
|
|||||||
* @return int Number of rows.
|
* @return int Number of rows.
|
||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return $this->db->query( $this->getSQL(true) )->fetchColumn();
|
return $this->db->query( $this->getSQL(true) )->fetchColumn();
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
|
|||||||
*
|
*
|
||||||
* @return int Number of items.
|
* @return int Number of items.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($items);
|
return count($items);
|
||||||
}
|
}
|
||||||
|
@ -538,6 +538,7 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return Iterator List of players.
|
* @return Iterator List of players.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return $this->getPlayersList();
|
return $this->getPlayersList();
|
||||||
@ -552,7 +553,7 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return int Count of players.
|
* @return int Count of players.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return $this->getPlayersList()->count();
|
return $this->getPlayersList()->count();
|
||||||
}
|
}
|
||||||
|
@ -196,6 +196,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
|||||||
* @since 0.1.5
|
* @since 0.1.5
|
||||||
* @return AppendIterator Iterator for all groups.
|
* @return AppendIterator Iterator for all groups.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
$iterator = new AppendIterator();
|
$iterator = new AppendIterator();
|
||||||
@ -210,7 +211,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
|||||||
* @since 0.1.5
|
* @since 0.1.5
|
||||||
* @return int Amount of all groups.
|
* @return int Amount of all groups.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->groups);
|
return count($this->groups);
|
||||||
}
|
}
|
||||||
|
@ -709,6 +709,7 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return Iterator List of ranks.
|
* @return Iterator List of ranks.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return $this->getGuildRanksList();
|
return $this->getGuildRanksList();
|
||||||
@ -723,7 +724,7 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return int Count of ranks.
|
* @return int Count of ranks.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return $this->getGuildRanksList()->count();
|
return $this->getGuildRanksList()->count();
|
||||||
}
|
}
|
||||||
|
@ -396,6 +396,7 @@ class OTS_GuildRank extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return Iterator List of players.
|
* @return Iterator List of players.
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return $this->getPlayersList();
|
return $this->getPlayersList();
|
||||||
@ -410,7 +411,7 @@ class OTS_GuildRank extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
* @throws PDOException On PDO operation error.
|
* @throws PDOException On PDO operation error.
|
||||||
* @return int Count of players.
|
* @return int Count of players.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return $this->getPlayersList()->count();
|
return $this->getPlayersList()->count();
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
|
|||||||
*
|
*
|
||||||
* @return int Count of houses.
|
* @return int Count of houses.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->houses);
|
return count($this->houses);
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ class OTS_Item implements Countable
|
|||||||
*
|
*
|
||||||
* @return int Count of item.
|
* @return int Count of item.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return $this->count;
|
return $this->count;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
|
|||||||
*
|
*
|
||||||
* @return int Count of types.
|
* @return int Count of types.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->items);
|
return count($this->items);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
|||||||
*
|
*
|
||||||
* @return int Count of monsters.
|
* @return int Count of monsters.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->monsters);
|
return count($this->monsters);
|
||||||
}
|
}
|
||||||
|
@ -630,7 +630,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
|
|||||||
* @since 0.0.8
|
* @since 0.0.8
|
||||||
* @return int Count of towns.
|
* @return int Count of towns.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->towns);
|
return count($this->towns);
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
|
|||||||
* @since 0.1.5
|
* @since 0.1.5
|
||||||
* @return int Amount of all spells.
|
* @return int Amount of all spells.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->runes) + count($this->instants) + count($this->conjures);
|
return count($this->runes) + count($this->instants) + count($this->conjures);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
|
|||||||
*
|
*
|
||||||
* @return int Count of vocations.
|
* @return int Count of vocations.
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->vocations);
|
return count($this->vocations);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user