From f31a1c178225e60ba6f4ec309db017de45e14489 Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 21 Apr 2020 17:57:36 +0200 Subject: [PATCH] fixed number mismatch declerations code cleanups --- .../Common/CommonCommandStructure.php | 2 - .../Common/CommonDefaultEventStructure.php | 1 - .../Common/CommonScoresStructure.php | 2 - .../ManiaPlanet/StartEndStructure.php | 2 +- .../ShootMania/OnArmorEmptyStructure.php | 2 +- .../ShootMania/OnCaptureStructure.php | 4 +- .../ShootMania/OnDefaultEventStructure.php | 4 +- .../ShootMania/OnNearMissStructure.php | 2 +- .../OnPlayerRequestRespawnStructure.php | 4 +- .../ShootMania/OnScoresStructure.php | 2 +- .../ShootMania/OnShootStructure.php | 2 +- .../ShootMania/OnShotDenyStructure.php | 2 +- .../TrackMania/OnDefaultEventStructure.php | 6 +- .../TrackMania/OnRespawnStructure.php | 2 +- core/ManiaExchange/MXMapInfo.php | 2 +- core/Manialinks/StyleManager.php | 2 +- core/Plugins/InstallMenu.php | 1 - core/Server/Commands.php | 24 ++- core/Server/RankingManager.php | 5 +- core/Server/ServerUIPropertiesMenu.php | 6 +- core/Statistics/SimpleStatsList.php | 4 +- core/Utils/Formatter.php | 2 +- libs/FML/Controls/Graph.php | 165 +++++++++--------- libs/React/Socket/ConnectionInterface.php | 6 +- .../core/Manialinks/CustomUIManagerTest.php | 2 - plugins/MCTeam/CustomVotesPlugin.php | 4 +- plugins/MCTeam/DonationPlugin.php | 3 +- plugins/MCTeam/KarmaPlugin.php | 4 +- 28 files changed, 121 insertions(+), 146 deletions(-) diff --git a/core/Callbacks/Structures/Common/CommonCommandStructure.php b/core/Callbacks/Structures/Common/CommonCommandStructure.php index 96146e02..3d497f8c 100644 --- a/core/Callbacks/Structures/Common/CommonCommandStructure.php +++ b/core/Callbacks/Structures/Common/CommonCommandStructure.php @@ -3,8 +3,6 @@ namespace ManiaControl\Callbacks\Structures\Common; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; -use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\ManiaControl; /** diff --git a/core/Callbacks/Structures/Common/CommonDefaultEventStructure.php b/core/Callbacks/Structures/Common/CommonDefaultEventStructure.php index 6a0e1c79..5d2670ec 100644 --- a/core/Callbacks/Structures/Common/CommonDefaultEventStructure.php +++ b/core/Callbacks/Structures/Common/CommonDefaultEventStructure.php @@ -3,7 +3,6 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\ManiaControl; diff --git a/core/Callbacks/Structures/Common/CommonScoresStructure.php b/core/Callbacks/Structures/Common/CommonScoresStructure.php index a988ab25..91447bd7 100644 --- a/core/Callbacks/Structures/Common/CommonScoresStructure.php +++ b/core/Callbacks/Structures/Common/CommonScoresStructure.php @@ -5,8 +5,6 @@ namespace ManiaControl\Callbacks\Structures\Common; use ManiaControl\Callbacks\Structures\Common\Models\CommonPlayerScore; use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore; -use ManiaControl\General\JsonSerializable; -use ManiaControl\General\JsonSerializeTrait; use ManiaControl\ManiaControl; /** diff --git a/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php b/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php index ddf37ab3..88da64dc 100644 --- a/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php +++ b/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php @@ -3,7 +3,7 @@ namespace ManiaControl\Callbacks\Structures\ManiaPlanet; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; + use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\ManiaControl; diff --git a/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php b/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php index d6f5b0e1..1b278611 100644 --- a/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php @@ -2,7 +2,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; -use ManiaControl\ManiaControl; + /** * Structure Class for the OnArmorEmpty Structure Callback diff --git a/core/Callbacks/Structures/ShootMania/OnCaptureStructure.php b/core/Callbacks/Structures/ShootMania/OnCaptureStructure.php index c98e1812..f80dba1a 100644 --- a/core/Callbacks/Structures/ShootMania/OnCaptureStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnCaptureStructure.php @@ -4,8 +4,8 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; use ManiaControl\Callbacks\Structures\Common\BaseStructure; -use ManiaControl\Callbacks\Structures\ShootMania\Models\Landmark; -use ManiaControl\Callbacks\Structures\ShootMania\Models\Position; + + use ManiaControl\ManiaControl; use ManiaControl\Players\Player; diff --git a/core/Callbacks/Structures/ShootMania/OnDefaultEventStructure.php b/core/Callbacks/Structures/ShootMania/OnDefaultEventStructure.php index 46d5be7e..511cc3d4 100644 --- a/core/Callbacks/Structures/ShootMania/OnDefaultEventStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnDefaultEventStructure.php @@ -3,8 +3,8 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; -use ManiaControl\ManiaControl; + + /** * Structure Class for the Default Event Structure Callback diff --git a/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php b/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php index e0f2147f..10a7be3e 100644 --- a/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php @@ -3,7 +3,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; -use ManiaControl\ManiaControl; + /** * Structure Class for the OnNearMiss Structure Callback diff --git a/core/Callbacks/Structures/ShootMania/OnPlayerRequestRespawnStructure.php b/core/Callbacks/Structures/ShootMania/OnPlayerRequestRespawnStructure.php index a94cc2f0..033e617c 100644 --- a/core/Callbacks/Structures/ShootMania/OnPlayerRequestRespawnStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnPlayerRequestRespawnStructure.php @@ -4,9 +4,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; -use ManiaControl\ManiaControl; -use ManiaControl\Players\Player; + /** * Structure Class for the OnPlayerRequestRespawnStructure Structure Callback diff --git a/core/Callbacks/Structures/ShootMania/OnScoresStructure.php b/core/Callbacks/Structures/ShootMania/OnScoresStructure.php index c1aaaa24..29d91752 100644 --- a/core/Callbacks/Structures/ShootMania/OnScoresStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnScoresStructure.php @@ -5,7 +5,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; use ManiaControl\Callbacks\Structures\Common\CommonScoresStructure; use ManiaControl\Callbacks\Structures\ShootMania\Models\PlayerScore; -use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore; + use ManiaControl\ManiaControl; diff --git a/core/Callbacks/Structures/ShootMania/OnShootStructure.php b/core/Callbacks/Structures/ShootMania/OnShootStructure.php index ec4d8a1c..4ca33824 100644 --- a/core/Callbacks/Structures/ShootMania/OnShootStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnShootStructure.php @@ -3,7 +3,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; + use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\ManiaControl; use ManiaControl\Players\Player; diff --git a/core/Callbacks/Structures/ShootMania/OnShotDenyStructure.php b/core/Callbacks/Structures/ShootMania/OnShotDenyStructure.php index 04f20b0a..a9c434a3 100644 --- a/core/Callbacks/Structures/ShootMania/OnShotDenyStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnShotDenyStructure.php @@ -3,7 +3,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; + use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\ManiaControl; diff --git a/core/Callbacks/Structures/TrackMania/OnDefaultEventStructure.php b/core/Callbacks/Structures/TrackMania/OnDefaultEventStructure.php index 76b71db8..3adc04a0 100644 --- a/core/Callbacks/Structures/TrackMania/OnDefaultEventStructure.php +++ b/core/Callbacks/Structures/TrackMania/OnDefaultEventStructure.php @@ -3,10 +3,10 @@ namespace ManiaControl\Callbacks\Structures\TrackMania; -use ManiaControl\Callbacks\Structures\Common\BaseStructure; -use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; + + use ManiaControl\Callbacks\Structures\ShootMania\CommonDefaultEventStructure; -use ManiaControl\ManiaControl; + /** * Structure Class for the Default Event Structure Callback diff --git a/core/Callbacks/Structures/TrackMania/OnRespawnStructure.php b/core/Callbacks/Structures/TrackMania/OnRespawnStructure.php index 7d76b129..96070671 100644 --- a/core/Callbacks/Structures/TrackMania/OnRespawnStructure.php +++ b/core/Callbacks/Structures/TrackMania/OnRespawnStructure.php @@ -6,7 +6,7 @@ namespace ManiaControl\Callbacks\Structures\TrackMania; use ManiaControl\Callbacks\Models\RecordCallback; use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure; use ManiaControl\ManiaControl; -use ManiaControl\Utils\Formatter; + /** * Structure Class for the On Respawn Structure Callback diff --git a/core/ManiaExchange/MXMapInfo.php b/core/ManiaExchange/MXMapInfo.php index ed9c6a2f..2ede42f9 100644 --- a/core/ManiaExchange/MXMapInfo.php +++ b/core/ManiaExchange/MXMapInfo.php @@ -28,7 +28,7 @@ class MXMapInfo { * * @param String $prefix MX URL prefix * @param $mx - * @return MXMapInfo + * @return \ManiaControl\ManiaExchange\MXMapInfo|void */ public function __construct($prefix, $mx) { $this->prefix = $prefix; diff --git a/core/Manialinks/StyleManager.php b/core/Manialinks/StyleManager.php index 0d98d21b..62243cb5 100644 --- a/core/Manialinks/StyleManager.php +++ b/core/Manialinks/StyleManager.php @@ -12,7 +12,7 @@ use FML\Controls\Quads\Quad_BgRaceScore2; use FML\Controls\Quads\Quad_Bgs1InRace; use FML\Controls\Quads\Quad_BgsPlayerCard; use FML\Controls\Quads\Quad_Icons64x64_1; -use FML\Controls\Quads\Quad_UIConstruction_Buttons; + use FML\Script\Features\Paging; use FML\Script\Script; use ManiaControl\General\UsageInformationAble; diff --git a/core/Plugins/InstallMenu.php b/core/Plugins/InstallMenu.php index 0be42d8e..679d28de 100644 --- a/core/Plugins/InstallMenu.php +++ b/core/Plugins/InstallMenu.php @@ -11,7 +11,6 @@ use FML\Script\Features\Paging; use FML\Script\Script; use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Configurator\ConfiguratorMenu; -use ManiaControl\Files\AsyncHttpRequest; use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Players\Player; diff --git a/core/Server/Commands.php b/core/Server/Commands.php index 882e31d2..a26b38dc 100644 --- a/core/Server/Commands.php +++ b/core/Server/Commands.php @@ -9,14 +9,12 @@ use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\Callbacks; use ManiaControl\Callbacks\Structures\Common\StatusCallbackStructure; -use ManiaControl\Callbacks\Structures\TrackMania\OnPointsRepartitionStructure; use ManiaControl\Callbacks\TimerListener; use ManiaControl\Commands\CommandListener; use ManiaControl\Logger; use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Players\Player; -use Maniaplanet\DedicatedServer\Xmlrpc\FaultException; use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; /** @@ -30,17 +28,17 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer /* * Constants */ - const ACTION_SET_PAUSE = 'ServerCommands.SetPause'; - const ACTION_EXTEND_WARMUP = 'ServerCommands.ExtendWarmup'; - const ACTION_END_WARMUP = 'ServerCommands.EndWarmup'; - const ACTION_CANCEL_VOTE = 'ServerCommands.CancelVote'; - const CB_VOTE_CANCELLED = 'ServerCommands.VoteCancelled'; - const SETTING_PERMISSION_CANCEL_VOTE = 'Cancel Vote'; - const SETTING_PERMISSION_SET_PAUSE = 'Set Pause'; - const SETTING_PERMISSION_HANDLE_WARMUP = 'Handle Warmup'; - const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo'; - const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server'; - const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings'; + const ACTION_SET_PAUSE = 'ServerCommands.SetPause'; + const ACTION_EXTEND_WARMUP = 'ServerCommands.ExtendWarmup'; + const ACTION_END_WARMUP = 'ServerCommands.EndWarmup'; + const ACTION_CANCEL_VOTE = 'ServerCommands.CancelVote'; + const CB_VOTE_CANCELLED = 'ServerCommands.VoteCancelled'; + const SETTING_PERMISSION_CANCEL_VOTE = 'Cancel Vote'; + const SETTING_PERMISSION_SET_PAUSE = 'Set Pause'; + const SETTING_PERMISSION_HANDLE_WARMUP = 'Handle Warmup'; + const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo'; + const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server'; + const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings'; /* * Private properties diff --git a/core/Server/RankingManager.php b/core/Server/RankingManager.php index 33cb440b..ececf934 100644 --- a/core/Server/RankingManager.php +++ b/core/Server/RankingManager.php @@ -11,6 +11,7 @@ use ManiaControl\ManiaControl; use ManiaControl\Maps\Map; use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; +//TODO delete this class /** * Class managing Rankings * @@ -109,7 +110,7 @@ class RankingManager implements CallbackListener, UsageInformationAble { array_multisort($this->rankings, SORT_DESC, SORT_NUMERIC); //TODO if Local Records activated-> sort asc - $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGSUPDATED, $this->getRankings()); + //$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGSUPDATED, $this->getRankings()); } /** @@ -134,7 +135,7 @@ class RankingManager implements CallbackListener, UsageInformationAble { return $leaders; } // FIXME: $leader doesn't exist - array_push($leaders, $leader); + //array_push($leaders, $leader); $prev = $score; } return null; diff --git a/core/Server/ServerUIPropertiesMenu.php b/core/Server/ServerUIPropertiesMenu.php index 8cc5560f..56e7674d 100644 --- a/core/Server/ServerUIPropertiesMenu.php +++ b/core/Server/ServerUIPropertiesMenu.php @@ -5,19 +5,19 @@ namespace ManiaControl\Server; use FML\Components\CheckBox; use FML\Controls\Entry; use FML\Controls\Frame; -use FML\Controls\Label; + use FML\Controls\Labels\Label_Text; use FML\Controls\Quad; use FML\Controls\Quads\Quad_Icons64x64_1; use FML\Script\Features\Paging; use FML\Script\Script; -use FML\XmlRpc\UIProperties; + use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\Callbacks; use ManiaControl\Callbacks\TimerListener; use ManiaControl\Callbacks\Structures\Common\UIPropertiesBaseStructure; -use ManiaControl\Configurator\Configurator; + use ManiaControl\Configurator\ConfiguratorMenu; use ManiaControl\Logger; use ManiaControl\ManiaControl; diff --git a/core/Statistics/SimpleStatsList.php b/core/Statistics/SimpleStatsList.php index dfa979d9..e11d7bde 100644 --- a/core/Statistics/SimpleStatsList.php +++ b/core/Statistics/SimpleStatsList.php @@ -3,7 +3,7 @@ namespace ManiaControl\Statistics; use FML\Controls\Frame; -use FML\Controls\Label; + use FML\Controls\Labels\Label_Text; use FML\Controls\Quad; use FML\Controls\Quads\Quad_BgsPlayerCard; @@ -15,7 +15,7 @@ use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\Callbacks; use ManiaControl\Commands\CommandListener; -use ManiaControl\Logger; + use ManiaControl\ManiaControl; use ManiaControl\Manialinks\LabelLine; use ManiaControl\Manialinks\ManialinkManager; diff --git a/core/Utils/Formatter.php b/core/Utils/Formatter.php index 39900534..c26ae575 100644 --- a/core/Utils/Formatter.php +++ b/core/Utils/Formatter.php @@ -225,7 +225,7 @@ abstract class Formatter implements UsageInformationAble { * Make sure the given Text is encoded in UTF-8 * * @param string $text - * @return string + * @return array|string */ public static function utf8($text) { if (is_array($text)) { diff --git a/libs/FML/Controls/Graph.php b/libs/FML/Controls/Graph.php index 64e3f319..4335b066 100644 --- a/libs/FML/Controls/Graph.php +++ b/libs/FML/Controls/Graph.php @@ -4,7 +4,6 @@ namespace FML\Controls; use FML\Script\Features\GraphCurve; use FML\Script\Features\GraphSettings; -use FML\Script\Features\ScriptFeature; /** * Graph Control @@ -14,100 +13,92 @@ use FML\Script\Features\ScriptFeature; * @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -class Graph extends Control -{ +class Graph extends Control { - /** - * @var GraphSettings $graphSettings Graph settings - */ - protected $graphSettings = null; + /** + * @var GraphSettings $graphSettings Graph settings + */ + protected $graphSettings = null; - /** - * @var GraphCurve[] $curves Curves - */ - protected $curves = array(); + /** + * @var GraphCurve[] $curves Curves + */ + protected $curves = array(); - /** - * Get the graph settings - * - * @api - * @return GraphSettings - */ - public function getSettings() - { - if (!$this->graphSettings) { - $this->createSettings(); - } - return $this->graphSettings; - } + /** + * Get the graph settings + * + * @api + * @return GraphSettings + */ + public function getSettings() { + if (!$this->graphSettings) { + $this->createSettings(); + } + return $this->graphSettings; + } - /** - * Create new graph settings - * - * @return GraphSettings - */ - protected function createSettings() - { - $this->graphSettings = new GraphSettings($this); - $this->addScriptFeature($this->graphSettings); - return $this->graphSettings; - } + /** + * Create new graph settings + * + * @return GraphSettings + */ + protected function createSettings() { + $this->graphSettings = new GraphSettings($this); + $this->addScriptFeature($this->graphSettings); + return $this->graphSettings; + } - /** - * Get curves - * - * @api - * @return GraphCurve[] - */ - public function getCurves() - { - return $this->curves; - } + /** + * Get curves + * + * @api + * @return GraphCurve[] + */ + public function getCurves() { + return $this->curves; + } - /** - * Add curve - * - * @api - * @param GraphCurve $curve Curve - * @return static - */ - public function addCurve(GraphCurve $curve) - { - $curve->setGraph($this); - $this->addScriptFeature($curve); - array_push($this->curves, $curve); - return $this; - } + /** + * Add curve + * + * @api + * @param GraphCurve $curve Curve + * @return static + */ + public function addCurve(GraphCurve $curve) { + $curve->setGraph($this); + $this->addScriptFeature($curve); + array_push($this->curves, $curve); + return $this; + } - /** - * Add curves - * - * @api - * @param GraphCurve[] $curves Curves - * @return static - */ - public function addCurves(array $curves) - { - foreach ($curves as $curve) { - $this->addCurve($curve); - } - return $this; - } + /** + * Add curves + * + * @api + * @param GraphCurve[] $curves Curves + * @return static + */ + public function addCurves(array $curves) { + foreach ($curves as $curve) { + $this->addCurve($curve); + } + return $this; + } - /** - * @see Control::getTagName() - */ - public function getTagName() - { - return "graph"; - } + /** + * @see Control::getTagName() + */ + public function getTagName() { + return "graph"; + } - /** - * @see Control::getManiaScriptClass() - */ - public function getManiaScriptClass() - { - return "CMlGraph"; - } + /** + * @see Control::getManiaScriptClass() + */ + public function getManiaScriptClass() { + return "CMlGraph"; + } } diff --git a/libs/React/Socket/ConnectionInterface.php b/libs/React/Socket/ConnectionInterface.php index 70dd8b1c..1339e562 100644 --- a/libs/React/Socket/ConnectionInterface.php +++ b/libs/React/Socket/ConnectionInterface.php @@ -2,11 +2,9 @@ namespace React\Socket; -use Evenement\EventEmitterInterface; use React\Stream\ReadableStreamInterface; use React\Stream\WritableStreamInterface; -interface ConnectionInterface extends ReadableStreamInterface, WritableStreamInterface -{ - public function getRemoteAddress(); +interface ConnectionInterface extends ReadableStreamInterface, WritableStreamInterface { + public function getRemoteAddress(); } diff --git a/phpunittests/core/Manialinks/CustomUIManagerTest.php b/phpunittests/core/Manialinks/CustomUIManagerTest.php index 241d28ee..e89ac555 100644 --- a/phpunittests/core/Manialinks/CustomUIManagerTest.php +++ b/phpunittests/core/Manialinks/CustomUIManagerTest.php @@ -1,7 +1,5 @@ maniaControl->getSettingManager()->initSetting($this, self::SETTING_SPECTATOR_ALLOW_START_VOTE, true); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_VOTE_TIME, 40); - $this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::CUSTOMVOTES_MENU_ID,$this,'showIcon'); + $this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::CUSTOMVOTES_MENU_ID, $this, 'showIcon'); //Define Votes $this->defineVote("teambalance", "Vote for Team Balance"); $this->defineVote("skipmap", "Vote for Skip Map")->setStopCallback(Callbacks::ENDMAP); diff --git a/plugins/MCTeam/DonationPlugin.php b/plugins/MCTeam/DonationPlugin.php index f35858b9..4c01eb07 100644 --- a/plugins/MCTeam/DonationPlugin.php +++ b/plugins/MCTeam/DonationPlugin.php @@ -10,7 +10,6 @@ use FML\Controls\Quads\Quad_BgRaceScore2; use FML\Controls\Quads\Quad_BgsPlayerCard; use FML\ManiaLink; use FML\Script\Features\Paging; -use ManiaControl\Admin\ActionsMenu; use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Bills\BillManager; use ManiaControl\Callbacks\CallbackListener; @@ -120,7 +119,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb // Define player stats $this->maniaControl->getStatisticManager()->defineStatMetaData(self::STAT_PLAYER_DONATIONS); - $this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5,self::DONATIONPLUGIN_MENU_ID,$this,'displayDonateWidget'); + $this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::DONATIONPLUGIN_MENU_ID, $this, 'displayDonateWidget'); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED, true); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000"); diff --git a/plugins/MCTeam/KarmaPlugin.php b/plugins/MCTeam/KarmaPlugin.php index c3df7883..f1d34978 100644 --- a/plugins/MCTeam/KarmaPlugin.php +++ b/plugins/MCTeam/KarmaPlugin.php @@ -736,7 +736,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { * Get all players votes * * @param Map $map - * @return array + * @return array|bool */ public function getMapPlayerVotes(Map $map) { $mysqli = $this->maniaControl->getDatabase()->getMysqli(); @@ -893,7 +893,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { * Get the current Votes for the Map * * @param Map $map - * @return array + * @return array|bool */ public function getMapVotes(Map $map) { $mysqli = $this->maniaControl->getDatabase()->getMysqli();