Add compatibility with PHP 8.1

This commit is contained in:
Beu 2023-01-16 10:55:46 +01:00
parent 9959373343
commit d109acae5c
4 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,8 @@
// Enable error reporting
error_reporting(E_ALL);
// Change MySQLi report to match with policy before PHP 8.1
mysqli_report(MYSQLI_REPORT_OFF);
// Run configuration
define('LOG_NAME_USE_DATE', true); // Use current date as suffix for log file name in logs folder

View File

@ -280,7 +280,7 @@ class HelpManager implements CommandListener, CallbackListener, ManialinkPageAns
* @param string $description
* @param string $method
*/
public function registerCommand($name, $adminCommand = false, $description = '', $method) {
public function registerCommand($name, $adminCommand = false, $description = '', $method = '') {
// TODO replace with new class Command
if ($adminCommand) {
array_push($this->adminCommands, array("Name" => $name, "Description" => $description, "Method" => $method));

View File

@ -571,7 +571,7 @@ class StatisticManager implements UsageInformationAble {
* @param string $statType
* @return bool
*/
public function insertStat($statName, Player $player, $serverIndex = -1, $value, $statType = self::STAT_TYPE_INT) {
public function insertStat($statName, Player $player, $serverIndex = -1, $value = 0, $statType = self::STAT_TYPE_INT) {
// TODO: statType isn't used
if (!$player) {
return false;

View File

@ -131,7 +131,7 @@ class RequestsQueue extends EventDispatcher implements RequestsQueueInterface, \
*
* @return int Handles count
*/
public function count() {
public function count(): int {
return count($this->queue);
}