diff --git a/core/AutoLoader.php b/core/AutoLoader.php index bd52ce99..39989625 100644 --- a/core/AutoLoader.php +++ b/core/AutoLoader.php @@ -15,7 +15,7 @@ abstract class AutoLoader { * Register the Auto Loader */ public static function register() { - spl_autoload_register(array(get_class(), 'autoload')); + spl_autoload_register(array(get_called_class(), 'autoload')); } /** diff --git a/core/Commands/HelpManager.php b/core/Commands/HelpManager.php index 601d80aa..30b2dd52 100644 --- a/core/Commands/HelpManager.php +++ b/core/Commands/HelpManager.php @@ -161,7 +161,7 @@ class HelpManager implements CommandListener, CallbackListener, ManialinkPageAns * @param Player $player * @return string */ - private function parseHelpList(array $commands, $isHelpAll = false, Player $player = null) { + private function parseHelpList(array $commands, $isHelpAll = false, ?Player $player = null) { $showCommands = array(); $registeredMethods = array(); $message = ''; diff --git a/core/Configurator/Configurator.php b/core/Configurator/Configurator.php index c26d6fe5..8427bb94 100644 --- a/core/Configurator/Configurator.php +++ b/core/Configurator/Configurator.php @@ -188,7 +188,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn * @param Player $player * @return \FML\ManiaLink */ - private function buildManialink($menuIdShown = 0, Player $player = null) { + private function buildManialink($menuIdShown = 0, ?Player $player = null) { $menuPosX = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MENU_POSX); $menuPosY = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MENU_POSY); $menuWidth = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MENU_WIDTH); diff --git a/core/Database/Database.php b/core/Database/Database.php index eed02c66..d08a3ae3 100644 --- a/core/Database/Database.php +++ b/core/Database/Database.php @@ -223,7 +223,7 @@ class Database implements TimerListener { * Check whether the Database Connection is still open */ public function checkConnection() { - if (!$this->getMysqli() || !@$this->getMysqli()->ping()) { + if (!$this->getMysqli() || !$this->getMysqli()->query('DO 1')) { $this->maniaControl->quit('The MySQL Server has gone away!', true); } } diff --git a/core/Manialinks/CustomUIManager.php b/core/Manialinks/CustomUIManager.php index 4eff5ccb..24d9c2b6 100644 --- a/core/Manialinks/CustomUIManager.php +++ b/core/Manialinks/CustomUIManager.php @@ -75,7 +75,7 @@ class CustomUIManager implements CallbackListener, TimerListener, UsageInformati * * @param Player $player */ - public function updateManialink(Player $player = null) { + public function updateManialink(?Player $player = null) { $this->maniaControl->getManialinkManager()->sendManialink($this->customUI, $player); } diff --git a/core/Maps/MapManager.php b/core/Maps/MapManager.php index e9b391fb..e78f7493 100644 --- a/core/Maps/MapManager.php +++ b/core/Maps/MapManager.php @@ -227,7 +227,7 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform * * @param ?Setting $setting */ - public function updateSettings(Setting $setting = null) { + public function updateSettings(?Setting $setting = null) { if (!isset($setting) || !$setting->belongsToClass($this)) return; if ($setting->setting === self::SETTING_ENABLE_MX) { @@ -378,7 +378,7 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform public function addMapFromMx($mapId, $login, $update = false) { if (is_numeric($mapId)) { // Check if map exists - $this->maniaControl->getMapManager()->getMXManager()->fetchMapInfo($mapId, function (MXMapInfo $mapInfo = null) use ( + $this->maniaControl->getMapManager()->getMXManager()->fetchMapInfo($mapId, function (?MXMapInfo $mapInfo = null) use ( &$login, &$update ) { if (!$mapInfo || !isset($mapInfo->uploaded)) { diff --git a/core/Maps/MapQueue.php b/core/Maps/MapQueue.php index 3d09ec10..5bb6089d 100644 --- a/core/Maps/MapQueue.php +++ b/core/Maps/MapQueue.php @@ -115,7 +115,7 @@ class MapQueue implements CallbackListener, CommandListener, UsageInformationAbl * * @param Player $admin |null */ - public function clearMapQueue(Player $admin = null) { + public function clearMapQueue(?Player $admin = null) { if ($admin && !$this->maniaControl->getAuthenticationManager()->checkPermission($admin, self::SETTING_PERMISSION_CLEAR_MAPQUEUE)) { $this->maniaControl->getAuthenticationManager()->sendNotAllowed($admin); return; diff --git a/core/Update/PluginUpdateManager.php b/core/Update/PluginUpdateManager.php index a11b7893..acb571aa 100644 --- a/core/Update/PluginUpdateManager.php +++ b/core/Update/PluginUpdateManager.php @@ -68,7 +68,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis * * @param Player $player */ - public function checkPluginsUpdate(Player $player = null) { + public function checkPluginsUpdate(?Player $player = null) { $message = 'Checking Plugins for newer Versions...'; if ($player) { $this->maniaControl->getChat()->sendInformation($message, $player); @@ -165,7 +165,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis * * @param Player $player */ - public function performPluginsUpdate(Player $player = null) { + public function performPluginsUpdate(?Player $player = null) { $pluginsUpdates = $this->getPluginsUpdates(); if (empty($pluginsUpdates)) { $message = 'There are no Plugin Updates available!'; @@ -241,7 +241,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis * @param Player $player * @param bool $update */ - private function installPlugin(PluginUpdateData $pluginUpdateData, Player $player = null, $update = false) { + private function installPlugin(PluginUpdateData $pluginUpdateData, ?Player $player = null, $update = false) { if ($player && !$this->maniaControl->getAuthenticationManager()->checkPermission($player, InstallMenu::SETTING_PERMISSION_INSTALL_PLUGINS)) { $this->maniaControl->getAuthenticationManager()->sendNotAllowed($player); diff --git a/core/Update/UpdateManager.php b/core/Update/UpdateManager.php index 4f1e7021..241b6b8b 100644 --- a/core/Update/UpdateManager.php +++ b/core/Update/UpdateManager.php @@ -130,7 +130,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, * * @param UpdateData $coreUpdateData */ - public function setCoreUpdateData(UpdateData $coreUpdateData = null) { + public function setCoreUpdateData(?UpdateData $coreUpdateData = null) { $this->coreUpdateData = $coreUpdateData; } @@ -189,7 +189,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, * * @param UpdateData $updateData */ - public function handleUpdateCheck(UpdateData $updateData = null) { + public function handleUpdateCheck(?UpdateData $updateData = null) { if (!$this->checkUpdateData($updateData)) { // No new update available return; @@ -218,7 +218,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, * @param UpdateData $updateData * @return bool */ - public function checkUpdateData(UpdateData $updateData = null) { + public function checkUpdateData(?UpdateData $updateData = null) { if (!$updateData || !$updateData->url) { // Data corrupted return false; @@ -268,7 +268,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, * @param UpdateData $updateData * @return bool */ - public function checkUpdateDataBuildVersion(UpdateData $updateData = null) { + public function checkUpdateDataBuildVersion(?UpdateData $updateData = null) { if (!$updateData) { // Data corrupted return false; @@ -310,7 +310,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, * @param Player $player * @return bool */ - public function performCoreUpdate(Player $player = null) { + public function performCoreUpdate(?Player $player = null) { if (!$this->coreUpdateData) { $message = 'Update failed: No update Data available!'; if ($player) { @@ -490,7 +490,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, return; } - $this->checkCoreUpdateAsync(function (UpdateData $updateData = null) use (&$player) { + $this->checkCoreUpdateAsync(function (?UpdateData $updateData = null) use (&$player) { if (!$this->checkUpdateData($updateData)) { $this->maniaControl->getChat()->sendInformation('No Update available!', $player); return; @@ -563,7 +563,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener, * @param null $player */ private function checkAndHandleCoreUpdate($player = null) { - $this->checkCoreUpdateAsync(function (UpdateData $updateData = null) use (&$player) { + $this->checkCoreUpdateAsync(function (?UpdateData $updateData = null) use (&$player) { if (!$updateData) { if ($player) { $this->maniaControl->getChat()->sendError('Update is currently not possible!', $player); diff --git a/core/Utils/SystemUtil.php b/core/Utils/SystemUtil.php index 9c96b8d5..67e63bac 100644 --- a/core/Utils/SystemUtil.php +++ b/core/Utils/SystemUtil.php @@ -107,6 +107,16 @@ class SystemUtil { Logger::log($message . 'FOUND!'); } + // Check for Xml + $message = 'Checking for installed xml ... '; + if (!extension_loaded('SimpleXML')) { + Logger::log($message . 'NOT FOUND!'); + Logger::log(" -- You don't have xml installed! Check: https://www.php.net/manual/en/xml.setup.php"); + $success = false; + } else { + Logger::log($message . 'FOUND!'); + } + if (!$success) { // Missing requirements self::quit(); diff --git a/core/Utils/WebReader.php b/core/Utils/WebReader.php index 4e86732d..ff76dff5 100644 --- a/core/Utils/WebReader.php +++ b/core/Utils/WebReader.php @@ -22,7 +22,7 @@ abstract class WebReader { * @param callable $function * @return Response */ - public static function getUrl($url, callable $function = null) { + public static function getUrl($url, ?callable $function = null) { $request = static::newRequest($url); $response = $request->send(); if ($function) { @@ -73,7 +73,7 @@ abstract class WebReader { * @param callable $function * @return Response */ - public static function postUrl($url, $content = null, callable $function = null) { + public static function postUrl($url, $content = null, ?callable $function = null) { $request = static::newRequest($url); $request->getOptions()->set(CURLOPT_POST, true); // post method if ($content) { diff --git a/libs/FML/Components/CheckBox.php b/libs/FML/Components/CheckBox.php index 54f4367f..e26a4068 100644 --- a/libs/FML/Components/CheckBox.php +++ b/libs/FML/Components/CheckBox.php @@ -38,7 +38,7 @@ class CheckBox implements Renderable, ScriptFeatureable * @param bool $default (optional) Default value * @param Quad $quad (optional) CheckBox quad */ - public function __construct($name = null, $default = null, Quad $quad = null) + public function __construct($name = null, $default = null, ?Quad $quad = null) { $this->feature = new CheckBoxFeature(); if ($name) { diff --git a/libs/FML/Components/ValuePicker.php b/libs/FML/Components/ValuePicker.php index 149536e7..10d36211 100644 --- a/libs/FML/Components/ValuePicker.php +++ b/libs/FML/Components/ValuePicker.php @@ -39,7 +39,7 @@ class ValuePicker implements Renderable, ScriptFeatureable * @param string $default (optional) Default value * @param Label $label (optional) ValuePicker label */ - public function __construct($name = null, array $values = null, $default = null, Label $label = null) + public function __construct($name = null, ?array $values = null, $default = null, ?Label $label = null) { $this->feature = new ValuePickerFeature(); if ($name) { diff --git a/libs/FML/Controls/Audio.php b/libs/FML/Controls/Audio.php index 9f2d4deb..76cc1eed 100644 --- a/libs/FML/Controls/Audio.php +++ b/libs/FML/Controls/Audio.php @@ -191,7 +191,7 @@ class Audio extends Control implements Playable, Scriptable /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -209,7 +209,7 @@ class Audio extends Control implements Playable, Scriptable /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Controls/Entry.php b/libs/FML/Controls/Entry.php index dba8c6ca..4072360f 100644 --- a/libs/FML/Controls/Entry.php +++ b/libs/FML/Controls/Entry.php @@ -273,7 +273,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -291,7 +291,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Controls/Frame.php b/libs/FML/Controls/Frame.php index c329606d..52eb014f 100644 --- a/libs/FML/Controls/Frame.php +++ b/libs/FML/Controls/Frame.php @@ -103,7 +103,7 @@ class Frame extends Control implements Container * @deprecated Use Style * @see Style */ - public function setFormat(Format $format = null) + public function setFormat(?Format $format = null) { $this->format = $format; return $this; diff --git a/libs/FML/Controls/Frame3d.php b/libs/FML/Controls/Frame3d.php index 2c84adec..1f1e80dc 100644 --- a/libs/FML/Controls/Frame3d.php +++ b/libs/FML/Controls/Frame3d.php @@ -138,7 +138,7 @@ class Frame3d extends Frame implements Scriptable /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -156,7 +156,7 @@ class Frame3d extends Frame implements Scriptable /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Controls/Label.php b/libs/FML/Controls/Label.php index 4bf1639b..fabca7f0 100644 --- a/libs/FML/Controls/Label.php +++ b/libs/FML/Controls/Label.php @@ -467,7 +467,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -485,7 +485,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Controls/Quad.php b/libs/FML/Controls/Quad.php index c0fecc6a..fa218fc5 100644 --- a/libs/FML/Controls/Quad.php +++ b/libs/FML/Controls/Quad.php @@ -579,7 +579,7 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -597,7 +597,7 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Controls/TextEdit.php b/libs/FML/Controls/TextEdit.php index 13238767..1ae6f4fa 100644 --- a/libs/FML/Controls/TextEdit.php +++ b/libs/FML/Controls/TextEdit.php @@ -281,7 +281,7 @@ class TextEdit extends Control implements MultiLineable, Scriptable, Styleable, /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -299,7 +299,7 @@ class TextEdit extends Control implements MultiLineable, Scriptable, Styleable, /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Controls/Video.php b/libs/FML/Controls/Video.php index 614a9b92..9dbec1bb 100644 --- a/libs/FML/Controls/Video.php +++ b/libs/FML/Controls/Video.php @@ -191,7 +191,7 @@ class Video extends Control implements Playable, Scriptable /** * @see Scriptable::setScriptAction() */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null) + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null) { $this->scriptAction = (string)$scriptAction; $this->setScriptActionParameters($scriptActionParameters); @@ -209,7 +209,7 @@ class Video extends Control implements Playable, Scriptable /** * @see Scriptable::setScriptActionParameters() */ - public function setScriptActionParameters(array $scriptActionParameters = null) + public function setScriptActionParameters(?array $scriptActionParameters = null) { $this->scriptActionParameters = $scriptActionParameters; return $this; diff --git a/libs/FML/Elements/FrameModel.php b/libs/FML/Elements/FrameModel.php index 90b52b34..5f746883 100644 --- a/libs/FML/Elements/FrameModel.php +++ b/libs/FML/Elements/FrameModel.php @@ -41,7 +41,7 @@ class FrameModel implements Container, Identifiable, Renderable * @param Renderable[] $children Children * @return static */ - public static function create($modelId = null, array $children = null) + public static function create($modelId = null, ?array $children = null) { return new static($modelId, $children); } @@ -53,7 +53,7 @@ class FrameModel implements Container, Identifiable, Renderable * @param string $modelId Model id * @param Renderable[] $children Children */ - public function __construct($modelId = null, array $children = null) + public function __construct($modelId = null, ?array $children = null) { if ($modelId) { $this->setId($modelId); @@ -176,7 +176,7 @@ class FrameModel implements Container, Identifiable, Renderable * @deprecated Use Style * @see Style */ - public function setFormat(Format $format = null) + public function setFormat(?Format $format = null) { $this->format = $format; return $this; diff --git a/libs/FML/ManiaLink.php b/libs/FML/ManiaLink.php index 8bf73452..977db4a3 100644 --- a/libs/FML/ManiaLink.php +++ b/libs/FML/ManiaLink.php @@ -96,7 +96,7 @@ class ManiaLink * @param Renderable[] $children (optional) Children * @return static */ - public static function create($maniaLinkId = null, $version = null, $name = null, array $children = null) + public static function create($maniaLinkId = null, $version = null, $name = null, ?array $children = null) { return new static($maniaLinkId, $version, $name, $children); } @@ -110,7 +110,7 @@ class ManiaLink * @param string $name (optional) Name * @param Renderable[] $children (optional) Children */ - public function __construct($maniaLinkId = null, $version = null, $name = null, array $children = null) + public function __construct($maniaLinkId = null, $version = null, $name = null, ?array $children = null) { if (is_string($version) && (!$name || is_array($name)) && !$children) { // backwards-compatibility (version has been introduced later, if it's a string it's supposed to be the name) @@ -418,7 +418,7 @@ class ManiaLink * @param Dico $dico Dictionary * @return static */ - public function setDico(Dico $dico = null) + public function setDico(?Dico $dico = null) { $this->dico = $dico; return $this; @@ -445,7 +445,7 @@ class ManiaLink * @param Stylesheet $stylesheet Stylesheet * @return static */ - public function setStylesheet(Stylesheet $stylesheet = null) + public function setStylesheet(?Stylesheet $stylesheet = null) { $this->stylesheet = $stylesheet; return $this; @@ -489,7 +489,7 @@ class ManiaLink * @param Script $script Script * @return static */ - public function setScript(Script $script = null) + public function setScript(?Script $script = null) { $this->script = $script; return $this; diff --git a/libs/FML/ManiaLinks.php b/libs/FML/ManiaLinks.php index 9a1a96b1..73aebd25 100644 --- a/libs/FML/ManiaLinks.php +++ b/libs/FML/ManiaLinks.php @@ -29,7 +29,7 @@ class ManiaLinks * @param ManiaLink[] $children ManiaLink children * @return static */ - public static function create(array $children = null) + public static function create(?array $children = null) { return new static($children); } @@ -40,7 +40,7 @@ class ManiaLinks * @api * @param ManiaLink[] $children ManiaLink children */ - public function __construct(array $children = null) + public function __construct(?array $children = null) { if ($children) { $this->setChildren($children); @@ -162,7 +162,7 @@ class ManiaLinks * @param CustomUI $customUI CustomUI object * @return static */ - public function setCustomUI(CustomUI $customUI = null) + public function setCustomUI(?CustomUI $customUI = null) { $this->customUI = $customUI; return $this; diff --git a/libs/FML/Script/Features/ActionTrigger.php b/libs/FML/Script/Features/ActionTrigger.php index fc6b393b..f8d6b50f 100644 --- a/libs/FML/Script/Features/ActionTrigger.php +++ b/libs/FML/Script/Features/ActionTrigger.php @@ -41,7 +41,7 @@ class ActionTrigger extends ScriptFeature * @param Control $control (optional) Action Control * @param string $labelName (optional) Script label name */ - public function __construct($actionName = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) + public function __construct($actionName = null, ?Control $control = null, $labelName = ScriptLabel::MOUSECLICK) { if ($actionName) { $this->setActionName($actionName); @@ -96,7 +96,7 @@ class ActionTrigger extends ScriptFeature * @param Control $control Action Control * @return static */ - public function setControl(Control $control = null) + public function setControl(?Control $control = null) { if ($control) { $control->checkId(); diff --git a/libs/FML/Script/Features/CheckBoxFeature.php b/libs/FML/Script/Features/CheckBoxFeature.php index a5157f34..6cd9c7ad 100644 --- a/libs/FML/Script/Features/CheckBoxFeature.php +++ b/libs/FML/Script/Features/CheckBoxFeature.php @@ -66,7 +66,7 @@ class CheckBoxFeature extends ScriptFeature * @param Entry $entry (optional) Hidden Entry * @param bool $default (optional) Default value */ - public function __construct(Quad $quad = null, Entry $entry = null, $default = null) + public function __construct(?Quad $quad = null, ?Entry $entry = null, $default = null) { if ($quad) { $this->setQuad($quad); diff --git a/libs/FML/Script/Features/Clock.php b/libs/FML/Script/Features/Clock.php index 92b25302..12b738ad 100644 --- a/libs/FML/Script/Features/Clock.php +++ b/libs/FML/Script/Features/Clock.php @@ -41,7 +41,7 @@ class Clock extends ScriptFeature * @param bool $showSeconds (optional) Show the seconds * @param bool $showFullDate (optional) Show the date */ - public function __construct(Label $label = null, $showSeconds = true, $showFullDate = false) + public function __construct(?Label $label = null, $showSeconds = true, $showFullDate = false) { if ($label) { $this->setLabel($label); diff --git a/libs/FML/Script/Features/ControlScript.php b/libs/FML/Script/Features/ControlScript.php index f4103196..c3d1c281 100644 --- a/libs/FML/Script/Features/ControlScript.php +++ b/libs/FML/Script/Features/ControlScript.php @@ -41,7 +41,7 @@ class ControlScript extends ScriptFeature * @param string $scriptText (optional) Script text * @param string $labelName (optional) Script Label name */ - public function __construct(Control $control = null, $scriptText = null, $labelName = ScriptLabel::MOUSECLICK) + public function __construct(?Control $control = null, $scriptText = null, $labelName = ScriptLabel::MOUSECLICK) { if ($control) { $this->setControl($control); diff --git a/libs/FML/Script/Features/EntrySubmit.php b/libs/FML/Script/Features/EntrySubmit.php index a1842204..2991dcf8 100644 --- a/libs/FML/Script/Features/EntrySubmit.php +++ b/libs/FML/Script/Features/EntrySubmit.php @@ -35,7 +35,7 @@ class EntrySubmit extends ScriptFeature * @param Entry $entry (optional) Entry Control * @param string $url (optional) Submit url */ - public function __construct(Entry $entry = null, $url = null) + public function __construct(?Entry $entry = null, $url = null) { if ($entry) { $this->setEntry($entry); diff --git a/libs/FML/Script/Features/GraphCurve.php b/libs/FML/Script/Features/GraphCurve.php index 98831c63..a5126199 100644 --- a/libs/FML/Script/Features/GraphCurve.php +++ b/libs/FML/Script/Features/GraphCurve.php @@ -54,7 +54,7 @@ class GraphCurve extends ScriptFeature * @param Graph $graph (optional) Graph * @param array[] $points (optional) Points */ - public function __construct(Graph $graph = null, array $points = null) + public function __construct(?Graph $graph = null, ?array $points = null) { if ($graph) { $this->setGraph($graph); @@ -200,7 +200,7 @@ class GraphCurve extends ScriptFeature * @param float[] $color (optional) Color * @return static */ - public function setColor(array $color = null) + public function setColor(?array $color = null) { $this->color = $color; return $this; diff --git a/libs/FML/Script/Features/GraphSettings.php b/libs/FML/Script/Features/GraphSettings.php index 399e93c5..64f2c6d2 100644 --- a/libs/FML/Script/Features/GraphSettings.php +++ b/libs/FML/Script/Features/GraphSettings.php @@ -38,7 +38,7 @@ class GraphSettings extends ScriptFeature * @api * @param Graph $graph (optional) Graph */ - public function __construct(Graph $graph = null) + public function __construct(?Graph $graph = null) { if ($graph) { $this->setGraph($graph); diff --git a/libs/FML/Script/Features/MapInfo.php b/libs/FML/Script/Features/MapInfo.php index ce29d5e8..8d056df7 100644 --- a/libs/FML/Script/Features/MapInfo.php +++ b/libs/FML/Script/Features/MapInfo.php @@ -35,7 +35,7 @@ class MapInfo extends ScriptFeature * @param Control $control (optional) Map Info Control * @param string $labelName (optional) Script Label name */ - public function __construct(Control $control = null, $labelName = ScriptLabel::MOUSECLICK) + public function __construct(?Control $control = null, $labelName = ScriptLabel::MOUSECLICK) { if ($control) { $this->setControl($control); diff --git a/libs/FML/Script/Features/Menu.php b/libs/FML/Script/Features/Menu.php index 9e8ace41..387f5e07 100644 --- a/libs/FML/Script/Features/Menu.php +++ b/libs/FML/Script/Features/Menu.php @@ -40,7 +40,7 @@ class Menu extends ScriptFeature * @param Control $control (optional) Toggled Menu Control * @param bool $isStartElement (optional) Whether the Menu should start with the given Element */ - public function __construct(Control $item = null, Control $control = null, $isStartElement = true) + public function __construct(?Control $item = null, ?Control $control = null, $isStartElement = true) { if ($item && $control) { $this->addItem($item, $control, $isStartElement); @@ -116,7 +116,7 @@ class Menu extends ScriptFeature * @param MenuElement $startElement Start Element * @return static */ - public function setStartElement(MenuElement $startElement = null) + public function setStartElement(?MenuElement $startElement = null) { $this->startElement = $startElement; if ($startElement && !in_array($startElement, $this->elements, true)) { diff --git a/libs/FML/Script/Features/MenuElement.php b/libs/FML/Script/Features/MenuElement.php index a9fb48ef..fc62c938 100644 --- a/libs/FML/Script/Features/MenuElement.php +++ b/libs/FML/Script/Features/MenuElement.php @@ -32,7 +32,7 @@ class MenuElement * @param Control $item (optional) Item Control in the Menu bar * @param Control $control (optional) Toggled Menu Control */ - public function __construct(Control $item = null, Control $control = null) + public function __construct(?Control $item = null, ?Control $control = null) { if ($item) { $this->setItem($item); diff --git a/libs/FML/Script/Features/Paging.php b/libs/FML/Script/Features/Paging.php index 553b1d55..b6828dbf 100644 --- a/libs/FML/Script/Features/Paging.php +++ b/libs/FML/Script/Features/Paging.php @@ -73,7 +73,7 @@ class Paging extends ScriptFeature * @param PagingPage[] $pages (optional) Pages * @param PagingButton[] $buttons (optional) Pageing Buttons */ - public function __construct(Label $label = null, array $pages = null, array $buttons = null) + public function __construct(?Label $label = null, ?array $pages = null, ?array $buttons = null) { if ($label) { $this->setLabel($label); diff --git a/libs/FML/Script/Features/PagingButton.php b/libs/FML/Script/Features/PagingButton.php index 010c1aa6..0c3a2c28 100644 --- a/libs/FML/Script/Features/PagingButton.php +++ b/libs/FML/Script/Features/PagingButton.php @@ -32,7 +32,7 @@ class PagingButton * @param Control $control (optional) Paging Control * @param int $pagingCount (optional) Number of browsed pages per click */ - public function __construct(Control $control = null, $pagingCount = 1) + public function __construct(?Control $control = null, $pagingCount = 1) { if ($control) { $this->setControl($control); diff --git a/libs/FML/Script/Features/PagingPage.php b/libs/FML/Script/Features/PagingPage.php index 60b9a948..c12812e7 100644 --- a/libs/FML/Script/Features/PagingPage.php +++ b/libs/FML/Script/Features/PagingPage.php @@ -31,7 +31,7 @@ class PagingPage * @param Control $control (optional) Page Control * @param int $pageNumber (optional) Number of the Page */ - public function __construct(Control $control = null, $pageNumber = null) + public function __construct(?Control $control = null, $pageNumber = null) { if ($control) { $this->setControl($control); diff --git a/libs/FML/Script/Features/PlayerProfile.php b/libs/FML/Script/Features/PlayerProfile.php index 6cfa0ea9..c17b64db 100644 --- a/libs/FML/Script/Features/PlayerProfile.php +++ b/libs/FML/Script/Features/PlayerProfile.php @@ -46,7 +46,7 @@ class PlayerProfile extends ScriptFeature * @param Control $control (optional) Profile Control * @param string $labelName (optional) Script Label name */ - public function __construct($login = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK, $titleId = "Trackmania") + public function __construct($login = null, ?Control $control = null, $labelName = ScriptLabel::MOUSECLICK, $titleId = "Trackmania") { if ($login) { $this->setLogin($login); diff --git a/libs/FML/Script/Features/Preload.php b/libs/FML/Script/Features/Preload.php index 11df0473..4841cba3 100644 --- a/libs/FML/Script/Features/Preload.php +++ b/libs/FML/Script/Features/Preload.php @@ -27,7 +27,7 @@ class Preload extends ScriptFeature * @api * @param string[] $imageUrls (optional) Image urls */ - public function __construct(array $imageUrls = null) + public function __construct(?array $imageUrls = null) { if ($imageUrls) { $this->setImageUrls($imageUrls); diff --git a/libs/FML/Script/Features/RadioButtonGroupFeature.php b/libs/FML/Script/Features/RadioButtonGroupFeature.php index 555a14bc..890b7464 100644 --- a/libs/FML/Script/Features/RadioButtonGroupFeature.php +++ b/libs/FML/Script/Features/RadioButtonGroupFeature.php @@ -40,7 +40,7 @@ class RadioButtonGroupFeature extends ScriptFeature * @api * @param Entry $entry (optional) Hidden Entry */ - public function __construct(Entry $entry = null) + public function __construct(?Entry $entry = null) { if ($entry) { $this->setEntry($entry); diff --git a/libs/FML/Script/Features/Toggle.php b/libs/FML/Script/Features/Toggle.php index 395c1ac8..76346890 100644 --- a/libs/FML/Script/Features/Toggle.php +++ b/libs/FML/Script/Features/Toggle.php @@ -54,8 +54,8 @@ class Toggle extends ScriptFeature * @param bool $onlyHide (optional) If it should only hide the Control but not toggle */ public function __construct( - Control $togglingControl = null, - Control $toggledControl = null, + ?Control $togglingControl = null, + ?Control $toggledControl = null, $labelName = ScriptLabel::MOUSECLICK, $onlyShow = false, $onlyHide = false diff --git a/libs/FML/Script/Features/Tooltip.php b/libs/FML/Script/Features/Tooltip.php index ca87b3ff..38bffda3 100644 --- a/libs/FML/Script/Features/Tooltip.php +++ b/libs/FML/Script/Features/Tooltip.php @@ -54,7 +54,7 @@ class Tooltip extends ScriptFeature * @param bool $invert (optional) If the visibility toggling should be inverted * @param string $text (optional) Text to display if the TooltipControl is a Label */ - public function __construct(Control $hoverControl = null, Control $tooltipControl = null, $stayOnClick = null, $invert = null, $text = null) + public function __construct(?Control $hoverControl = null, ?Control $tooltipControl = null, $stayOnClick = null, $invert = null, $text = null) { if ($hoverControl) { $this->setHoverControl($hoverControl); diff --git a/libs/FML/Script/Features/UISound.php b/libs/FML/Script/Features/UISound.php index eba267ae..89a336c2 100644 --- a/libs/FML/Script/Features/UISound.php +++ b/libs/FML/Script/Features/UISound.php @@ -85,7 +85,7 @@ class UISound extends ScriptFeature * @param int $variant (optional) Sound variant * @param string $labelName (optional) Script Label name */ - public function __construct($soundName = null, Control $control = null, $variant = 0, $labelName = ScriptLabel::MOUSECLICK) + public function __construct($soundName = null, ?Control $control = null, $variant = 0, $labelName = ScriptLabel::MOUSECLICK) { if ($soundName) { $this->setSoundName($soundName); @@ -143,7 +143,7 @@ class UISound extends ScriptFeature * @param Control $control (optional) Sound Control * @return static */ - public function setControl(Control $control = null) + public function setControl(?Control $control = null) { if ($control) { $control->checkId(); diff --git a/libs/FML/Script/Features/ValuePickerFeature.php b/libs/FML/Script/Features/ValuePickerFeature.php index 38c06d1d..0c83fb06 100644 --- a/libs/FML/Script/Features/ValuePickerFeature.php +++ b/libs/FML/Script/Features/ValuePickerFeature.php @@ -56,7 +56,7 @@ class ValuePickerFeature extends ScriptFeature * @param string[] $values (optional) Possible values * @param string $default (optional) Default value */ - public function __construct(Label $label = null, Entry $entry = null, array $values = null, $default = null) + public function __construct(?Label $label = null, ?Entry $entry = null, ?array $values = null, $default = null) { if ($label) { $this->setLabel($label); diff --git a/libs/FML/Stylesheet/Stylesheet.php b/libs/FML/Stylesheet/Stylesheet.php index 617c0eaa..5a7868b3 100644 --- a/libs/FML/Stylesheet/Stylesheet.php +++ b/libs/FML/Stylesheet/Stylesheet.php @@ -150,7 +150,7 @@ class Stylesheet * @param Mood $mood Mood * @return static */ - public function setMood(Mood $mood = null) + public function setMood(?Mood $mood = null) { $this->mood = $mood; return $this; diff --git a/libs/FML/Types/Container.php b/libs/FML/Types/Container.php index 922ef595..714afe61 100644 --- a/libs/FML/Types/Container.php +++ b/libs/FML/Types/Container.php @@ -90,6 +90,6 @@ interface Container * @deprecated Use Style * @see Style */ - public function setFormat(Format $format = null); + public function setFormat(?Format $format = null); } diff --git a/libs/FML/Types/Scriptable.php b/libs/FML/Types/Scriptable.php index ce4fbe34..8a686166 100644 --- a/libs/FML/Types/Scriptable.php +++ b/libs/FML/Types/Scriptable.php @@ -45,7 +45,7 @@ interface Scriptable * @param string[] $scriptActionParameters (optional) Script action parameters * @return static */ - public function setScriptAction($scriptAction, array $scriptActionParameters = null); + public function setScriptAction($scriptAction, ?array $scriptActionParameters = null); /** * Get script action parameters @@ -62,6 +62,6 @@ interface Scriptable * @param string[] $scriptActionParameters (optional) Script action parameters * @return static */ - public function setScriptActionParameters(array $scriptActionParameters = null); + public function setScriptActionParameters(?array $scriptActionParameters = null); } diff --git a/libs/Maniaplanet/DedicatedServer/Structures/ServerPlugin.php b/libs/Maniaplanet/DedicatedServer/Structures/ServerPlugin.php new file mode 100755 index 00000000..fe9956dc --- /dev/null +++ b/libs/Maniaplanet/DedicatedServer/Structures/ServerPlugin.php @@ -0,0 +1,28 @@ +settingsDesc = ScriptSettings::fromArrayOfArray($object->paramDescs); + return $object; + } +} diff --git a/libs/React/EventLoop/ExtEventLoop.php b/libs/React/EventLoop/ExtEventLoop.php index b3d16b94..4a096920 100644 --- a/libs/React/EventLoop/ExtEventLoop.php +++ b/libs/React/EventLoop/ExtEventLoop.php @@ -28,7 +28,7 @@ class ExtEventLoop implements LoopInterface private $writeListeners = []; private $running; - public function __construct(EventBaseConfig $config = null) + public function __construct(?EventBaseConfig $config = null) { $this->eventBase = new EventBase($config); $this->nextTickQueue = new NextTickQueue($this); diff --git a/libs/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/libs/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php index 76f0e387..ee963084 100644 --- a/libs/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php +++ b/libs/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php @@ -160,7 +160,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher * * @throws \InvalidArgumentException if the service is not defined */ - public function dispatch($eventName, Event $event = null) + public function dispatch($eventName, ?Event $event = null) { $this->lazyLoad($eventName); diff --git a/libs/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php b/libs/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php index 7653ccfb..24c38b8b 100644 --- a/libs/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php +++ b/libs/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php @@ -40,7 +40,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface * @param Stopwatch $stopwatch A Stopwatch instance * @param LoggerInterface $logger A LoggerInterface instance */ - public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null) + public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null) { $this->dispatcher = $dispatcher; $this->stopwatch = $stopwatch; @@ -110,7 +110,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface /** * {@inheritdoc} */ - public function dispatch($eventName, Event $event = null) + public function dispatch($eventName, ?Event $event = null) { if (null === $event) { $event = new Event(); diff --git a/libs/Symfony/Component/EventDispatcher/Debug/WrappedListener.php b/libs/Symfony/Component/EventDispatcher/Debug/WrappedListener.php index e16627d6..858fc53a 100644 --- a/libs/Symfony/Component/EventDispatcher/Debug/WrappedListener.php +++ b/libs/Symfony/Component/EventDispatcher/Debug/WrappedListener.php @@ -27,7 +27,7 @@ class WrappedListener private $stopwatch; private $dispatcher; - public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) + public function __construct($listener, $name, Stopwatch $stopwatch, ?EventDispatcherInterface $dispatcher = null) { $this->listener = $listener; $this->name = $name; diff --git a/libs/Symfony/Component/EventDispatcher/EventDispatcher.php b/libs/Symfony/Component/EventDispatcher/EventDispatcher.php index 46c11100..e3364360 100644 --- a/libs/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/libs/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -37,7 +37,7 @@ class EventDispatcher implements EventDispatcherInterface * * @api */ - public function dispatch($eventName, Event $event = null) + public function dispatch($eventName, ?Event $event = null) { if (null === $event) { $event = new Event(); diff --git a/libs/Symfony/Component/EventDispatcher/EventDispatcherInterface.php b/libs/Symfony/Component/EventDispatcher/EventDispatcherInterface.php index 9d9fc4d4..38ca5867 100644 --- a/libs/Symfony/Component/EventDispatcher/EventDispatcherInterface.php +++ b/libs/Symfony/Component/EventDispatcher/EventDispatcherInterface.php @@ -35,7 +35,7 @@ interface EventDispatcherInterface * * @api */ - public function dispatch($eventName, Event $event = null); + public function dispatch($eventName, ?Event $event = null); /** * Adds an event listener that listens on the specified events. diff --git a/libs/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php b/libs/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php index 7ef9ece7..eaf977ec 100644 --- a/libs/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php +++ b/libs/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php @@ -38,7 +38,7 @@ class ImmutableEventDispatcher implements EventDispatcherInterface /** * {@inheritdoc} */ - public function dispatch($eventName, Event $event = null) + public function dispatch($eventName, ?Event $event = null) { return $this->dispatcher->dispatch($eventName, $event); } diff --git a/plugins/MCTeam/Common/RecordWidget.php b/plugins/MCTeam/Common/RecordWidget.php index 2078c754..c467faab 100644 --- a/plugins/MCTeam/Common/RecordWidget.php +++ b/plugins/MCTeam/Common/RecordWidget.php @@ -39,7 +39,7 @@ class RecordWidget { * @param \ManiaControl\Players\Player|null $player * @return \FML\Controls\Frame */ - public function generateRecordLineFrame($record, Player $player = null) { + public function generateRecordLineFrame($record, ?Player $player = null) { $width = $this->width; $lineHeight = $this->lineHeight; $largeNumberDiff = 0; @@ -92,6 +92,7 @@ class RecordWidget { $recordFrame->addChild($quad); $quad->setStyles(Quad_Bgs1InRace::STYLE, Quad_Bgs1InRace::SUBSTYLE_BgCardList); $quad->setSize($width, $lineHeight); + $quad->setZ(-1); } return $recordFrame; @@ -105,7 +106,7 @@ class RecordWidget { * @param \ManiaControl\Players\Player|null $player * @return \FML\Controls\Frame */ - public function generateRecordsFrame($records, $limit, Player $player = null) { + public function generateRecordsFrame($records, $limit, ?Player $player = null) { $lineHeight = $this->lineHeight; $frame = new Frame(); diff --git a/plugins/MCTeam/Dedimania/DedimaniaPlugin.php b/plugins/MCTeam/Dedimania/DedimaniaPlugin.php index cbe76e4a..89125822 100644 --- a/plugins/MCTeam/Dedimania/DedimaniaPlugin.php +++ b/plugins/MCTeam/Dedimania/DedimaniaPlugin.php @@ -83,7 +83,7 @@ class DedimaniaPlugin implements CallbackListener, CallQueueListener, CommandLis public static function prepare(ManiaControl $maniaControl) { $servers = $maniaControl->getServer()->getAllServers(); foreach ($servers as $server) { - $maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_DEDIMANIA_CODE . $server->login . '$l', ''); + $maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_DEDIMANIA_CODE . $server->login . '$l', ''); } } @@ -156,7 +156,7 @@ class DedimaniaPlugin implements CallbackListener, CallQueueListener, CommandLis $this->recordWidget = new RecordWidget($this->maniaControl); - if ($this->maniaControl->getServer()->getGameMode() == 0) { + if (true/*$this->maniaControl->getServer()->getGameMode() == 0*/) { $gameMode = $this->maniaControl->getClient()->getScriptName()['CurrentValue']; $this->isMultilap = ($gameMode == 'Laps.Script.txt' || $this->maniaControl->getMapManager()->getCurrentMap()->nbLaps > 0); $this->isRounds = ($gameMode == 'Rounds.Script.txt'); diff --git a/plugins/MCTeam/DynamicPointLimitPlugin.php b/plugins/MCTeam/DynamicPointLimitPlugin.php index a1d8ad67..2326106b 100644 --- a/plugins/MCTeam/DynamicPointLimitPlugin.php +++ b/plugins/MCTeam/DynamicPointLimitPlugin.php @@ -52,11 +52,11 @@ class DynamicPointLimitPlugin implements CallbackListener, CommandListener, Plug * @see \ManiaControl\Plugins\Plugin::prepare() */ public static function prepare(ManiaControl $maniaControl) { - $maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_POINT_LIMIT_MULTIPLIER, 10); - $maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_POINT_LIMIT_OFFSET, 0); - $maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_MIN_POINT_LIMIT, 30); - $maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_MAX_POINT_LIMIT, 200); - $maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_ACCEPT_OTHER_MODES, false); + $maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_POINT_LIMIT_MULTIPLIER, 10); + $maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_POINT_LIMIT_OFFSET, 0); + $maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_MIN_POINT_LIMIT, 30); + $maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_MAX_POINT_LIMIT, 200); + $maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_ACCEPT_OTHER_MODES, false); } /** diff --git a/plugins/MCTeam/KarmaPlugin.php b/plugins/MCTeam/KarmaPlugin.php index 2410dd50..673e1c8d 100644 --- a/plugins/MCTeam/KarmaPlugin.php +++ b/plugins/MCTeam/KarmaPlugin.php @@ -79,7 +79,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { * @see \ManiaControl\Plugins\Plugin::prepare() */ public static function prepare(ManiaControl $maniaControl) { - $thisClass = get_class(); + $thisClass = get_called_class(); $maniaControl->getSettingManager()->initSetting($thisClass, self::SETTING_MX_KARMA_ACTIVATED, true); $maniaControl->getSettingManager()->initSetting($thisClass, self::SETTING_MX_KARMA_IMPORTING, true); $maniaControl->getSettingManager()->initSetting($thisClass, self::SETTING_WIDGET_DISPLAY_MX, true); @@ -343,7 +343,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { /** * Fetch the mxKarmaVotes for the current map */ - public function getMxKarmaVotes(Player $player = null) { + public function getMxKarmaVotes(?Player $player = null) { if (!$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MX_KARMA_ACTIVATED)) { return; } @@ -901,7 +901,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { * @param Map $map * @param bool $forceBuild */ - private function buildManialink(Map $map = null, $forceBuild = false) { + private function buildManialink(?Map $map = null, $forceBuild = false) { if (!$forceBuild) { return; } @@ -915,7 +915,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { $quadStyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultQuadStyle(); $quadSubstyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultQuadSubstyle(); - $manialink = new ManiaLink(self::MLID_KARMA); + $manialink = new ManiaLink(self::MLID_KARMA, 3); $frame = new Frame(); $manialink->addChild($frame);