From 212517d2909bd4b535d04bd309f74eb470ee1f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Fri, 2 May 2014 16:13:45 +0200 Subject: [PATCH] added, fixed & improved PHPDoc & Type Hints --- application/ManiaControl.php | 1 + application/core/Admin/AdminLists.php | 2 +- application/core/Admin/AuthCommands.php | 6 +-- application/core/Bills/BillData.php | 6 +-- .../Callbacks/LibXmlRpcCallbackManager.php | 18 ++++++--- .../core/Callbacks/ShootManiaCallbacks.php | 1 + application/core/Callbacks/TimerManager.php | 7 ++-- application/core/Chat.php | 4 +- .../core/Configurators/Configurator.php | 12 +++--- .../core/Configurators/ScriptSettings.php | 2 +- application/core/ErrorHandler.php | 2 +- .../core/Files/AsynchronousFileReader.php | 11 +++--- application/core/ManiaControl.php | 1 + application/core/Maps/MapCommands.php | 39 ++++++++++++++++--- application/core/Maps/MapManager.php | 18 +++++---- application/core/Players/PlayerActions.php | 2 - application/core/Players/PlayerCommands.php | 4 +- .../core/Players/PlayerDataManager.php | 23 +++++------ application/core/Players/PlayerDetailed.php | 17 +++++++- application/core/Players/PlayerList.php | 6 ++- application/core/Players/PlayerManager.php | 8 ++-- .../core/Plugins/PluginInstallMenu.php | 1 + application/core/Plugins/PluginManager.php | 2 +- application/core/Server/ServerCommands.php | 3 +- application/core/Settings/SettingManager.php | 3 +- .../core/Statistics/SimpleStatsList.php | 3 +- .../core/Statistics/StatisticCollector.php | 10 +++-- application/core/Update/PluginUpdateData.php | 2 +- .../core/Update/PluginUpdateManager.php | 1 + application/core/Update/UpdateManager.php | 1 + application/plugins/Donations.php | 14 +++---- application/plugins/WidgetPlugin.php | 16 ++++---- 32 files changed, 157 insertions(+), 89 deletions(-) diff --git a/application/ManiaControl.php b/application/ManiaControl.php index f6043cee..4ed1ab33 100644 --- a/application/ManiaControl.php +++ b/application/ManiaControl.php @@ -72,6 +72,7 @@ else { * Log and echo the given text * * @param string $message + * @param bool $eol */ function logMessage($message, $eol = true) { $date = date("d.M y H:i:s"); diff --git a/application/core/Admin/AdminLists.php b/application/core/Admin/AdminLists.php index bf83d7ae..dfa3a5c9 100644 --- a/application/core/Admin/AdminLists.php +++ b/application/core/Admin/AdminLists.php @@ -227,7 +227,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener { /** * Reopen the widget on Map Begin, MapListChanged, etc. * - * @param array $callback + * @param Player $player */ public function updateWidget(Player $player) { foreach($this->adminListShown as $login => $shown) { diff --git a/application/core/Admin/AuthCommands.php b/application/core/Admin/AuthCommands.php index 2dccd93c..394b1c4a 100644 --- a/application/core/Admin/AuthCommands.php +++ b/application/core/Admin/AuthCommands.php @@ -28,9 +28,9 @@ class AuthCommands implements CommandListener { $this->maniaControl = $maniaControl; // Register for commands - $this->maniaControl->commandManager->registerCommandListener('addsuperadmin', $this, 'command_AddSuperAdmin',true, 'Adds player to adminlist as SuperAdmin.'); - $this->maniaControl->commandManager->registerCommandListener('addadmin', $this, 'command_AddAdmin',true, 'Adds player to adminlist as Admin.'); - $this->maniaControl->commandManager->registerCommandListener('addmod', $this, 'command_AddModerator',true, 'Add player to adminlist as Moderator.'); + $this->maniaControl->commandManager->registerCommandListener('addsuperadmin', $this, 'command_AddSuperAdmin',true, 'Add Player to the AdminList as SuperAdmin.'); + $this->maniaControl->commandManager->registerCommandListener('addadmin', $this, 'command_AddAdmin',true, 'Add Player to the AdminList as Admin.'); + $this->maniaControl->commandManager->registerCommandListener('addmod', $this, 'command_AddModerator',true, 'Add Player to the AdminList as Moderator.'); } /** diff --git a/application/core/Bills/BillData.php b/application/core/Bills/BillData.php index a1606c7f..ff5090e5 100644 --- a/application/core/Bills/BillData.php +++ b/application/core/Bills/BillData.php @@ -17,7 +17,7 @@ class BillData { public $function = null; public $pay = false; public $player = null; - public $receiverLogin = false; + public $receiverLogin = null; public $amount = 0; public $creationTime = -1; @@ -26,10 +26,10 @@ class BillData { * @param mixed $function * @param Player $player * @param int $amount - * @param string $pay + * @param bool $pay * @param string $receiverLogin */ - public function __construct($function, $player, $amount, $pay = false, $receiverLogin = false) { + public function __construct($function, Player $player, $amount, $pay = false, $receiverLogin = null) { $this->function = $function; $this->player = $player; $this->amount = $amount; diff --git a/application/core/Callbacks/LibXmlRpcCallbackManager.php b/application/core/Callbacks/LibXmlRpcCallbackManager.php index dea0bad3..5b004e64 100644 --- a/application/core/Callbacks/LibXmlRpcCallbackManager.php +++ b/application/core/Callbacks/LibXmlRpcCallbackManager.php @@ -5,6 +5,13 @@ namespace ManiaControl\Callbacks; use ManiaControl\ManiaControl; +/** + * Class managing & converting LibXmlRpc Callbacks + * + * @author ManiaControl Team + * @copyright ManiaControl Copyright © 2014 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ class LibXmlRpcCallbackManager implements CallbackListener { /* * Private Properties @@ -15,6 +22,7 @@ class LibXmlRpcCallbackManager implements CallbackListener { * Create a new LibXmlRpc Callbacks Instance * * @param ManiaControl $maniaControl + * @param CallbackManager $callbackManager */ public function __construct(ManiaControl $maniaControl, CallbackManager $callbackManager) { $this->maniaControl = $maniaControl; @@ -24,10 +32,10 @@ class LibXmlRpcCallbackManager implements CallbackListener { /** * Handle Script Callbacks * - * @param $name - * @param $data + * @param string $name + * @param array $data */ - public function handleScriptCallbacks($name, $data) { + public function handleScriptCallbacks($name, array $data) { switch($name) { case 'LibXmlRpc_BeginMatch': $this->maniaControl->callbackManager->triggerCallback(Callbacks::BEGINMATCH, $data[0]); @@ -76,9 +84,9 @@ class LibXmlRpcCallbackManager implements CallbackListener { /** * Triggers the Ranking of a Player * - * @param $data + * @param array $data */ - private function triggerPlayerRanking($data) { + private function triggerPlayerRanking(array $data) { $player = $this->maniaControl->playerManager->getPlayer($data[1]); $this->maniaControl->callbackManager->triggerCallback(Callbacks::PLAYERRANKING, $player, $data[0], $data[6], $data[5]); } diff --git a/application/core/Callbacks/ShootManiaCallbacks.php b/application/core/Callbacks/ShootManiaCallbacks.php index d820e17d..a04d1def 100644 --- a/application/core/Callbacks/ShootManiaCallbacks.php +++ b/application/core/Callbacks/ShootManiaCallbacks.php @@ -29,6 +29,7 @@ class ShootManiaCallbacks implements CallbackListener { * Create a new ShootMania Callbacks Instance * * @param ManiaControl $maniaControl + * @param CallbackManager $callbackManager */ public function __construct(ManiaControl $maniaControl, CallbackManager $callbackManager) { $this->maniaControl = $maniaControl; diff --git a/application/core/Callbacks/TimerManager.php b/application/core/Callbacks/TimerManager.php index 6d3ac808..5d387cd4 100644 --- a/application/core/Callbacks/TimerManager.php +++ b/application/core/Callbacks/TimerManager.php @@ -55,11 +55,12 @@ class TimerManager { } /** - * Register a Timing Listening, note < 10ms it can get inaccurate + * Register a Timer Listening, note < 10ms it can get inaccurate * * @param TimerListener $listener - * @param $method - * @param $time + * @param string $method + * @param float $time + * @param bool $oneTime * @return bool */ public function registerTimerListening(TimerListener $listener, $method, $time, $oneTime = false) { diff --git a/application/core/Chat.php b/application/core/Chat.php index 56e7685b..f4303651 100644 --- a/application/core/Chat.php +++ b/application/core/Chat.php @@ -131,14 +131,14 @@ class Chat { /** * Send the Exception Information to the Chat * - * @param Exception $exception + * @param \Exception $exception * @param string $login * @return bool */ public function sendException(\Exception $exception, $login = null) { $message = "Exception occurred: '{$exception->getMessage()}' ({$exception->getCode()})"; $this->maniaControl->errorHandler->triggerDebugNotice($message); - $this->sendError($message, $login); + return $this->sendError($message, $login); } /** diff --git a/application/core/Configurators/Configurator.php b/application/core/Configurators/Configurator.php index 0c687225..6a433034 100644 --- a/application/core/Configurators/Configurator.php +++ b/application/core/Configurators/Configurator.php @@ -103,6 +103,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn * Handle Config Admin Command * * @param array $callback + * @param Player $player */ public function handleConfigCommand(array $callback, Player $player) { if (!$this->maniaControl->authenticationManager->checkPermission($player, self::SETTING_PERMISSION_OPEN_CONFIGURATOR)) { @@ -123,11 +124,12 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn } /** - * Reopens the Menu + * Reopen the Menu * - * @param array $callback + * @param Player $player + * @param int $menuId */ - public function reopenMenu($player, $menuId = 0) { + public function reopenMenu(Player $player, $menuId = 0) { $this->showMenu($player, $menuId); } @@ -240,10 +242,10 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn } /** - * Build menu manialink if necessary + * Build Menu ManiaLink if necessary * * @param int $menuIdShown - * @internal param bool $forceBuild + * @param Player $player * @return \FML\ManiaLink */ private function buildManialink($menuIdShown = 0, Player $player) { diff --git a/application/core/Configurators/ScriptSettings.php b/application/core/Configurators/ScriptSettings.php index c9cc8801..24ec4071 100644 --- a/application/core/Configurators/ScriptSettings.php +++ b/application/core/Configurators/ScriptSettings.php @@ -399,7 +399,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener { * * @param array $newSettings * @param Player $player - * @param bool + * @return bool */ private function applyNewScriptSettings(array $newSettings, Player $player) { if (!$newSettings) { diff --git a/application/core/ErrorHandler.php b/application/core/ErrorHandler.php index 458b38ef..8ddcd4ad 100644 --- a/application/core/ErrorHandler.php +++ b/application/core/ErrorHandler.php @@ -43,9 +43,9 @@ class ErrorHandler { /** * ManiaControl ExceptionHandler - * ManiaControl Shuts down after exception * * @param \Exception $ex + * @param bool $shutdown */ public function exceptionHandler(\Exception $ex, $shutdown = true) { // Log exception diff --git a/application/core/Files/AsynchronousFileReader.php b/application/core/Files/AsynchronousFileReader.php index 7701a8ea..bc3c73f4 100644 --- a/application/core/Files/AsynchronousFileReader.php +++ b/application/core/Files/AsynchronousFileReader.php @@ -55,8 +55,9 @@ class AsynchronousFileReader { * Load a remote file * * @param string $url - * @param $function + * @param callable $function * @param string $contentType + * @param int $keepAlive * @return bool */ public function loadFile($url, $function, $contentType = 'UTF-8', $keepAlive = 0) { @@ -118,10 +119,10 @@ class AsynchronousFileReader { /** * Send Data via POST Method * - * @param $url - * @param $function - * @param $content - * @param string $compression + * @param string $url + * @param callable $function + * @param string $content + * @param bool $compression * @param string $contentType * @return bool */ diff --git a/application/core/ManiaControl.php b/application/core/ManiaControl.php index 5c3db1d7..937aee91 100644 --- a/application/core/ManiaControl.php +++ b/application/core/ManiaControl.php @@ -167,6 +167,7 @@ class ManiaControl implements CommandListener, TimerListener { * Print a message to console and log * * @param string $message + * @param bool $stripCodes */ public function log($message, $stripCodes = false) { if ($stripCodes) { diff --git a/application/core/Maps/MapCommands.php b/application/core/Maps/MapCommands.php index 03a23b2c..7d5891b8 100644 --- a/application/core/Maps/MapCommands.php +++ b/application/core/Maps/MapCommands.php @@ -312,6 +312,11 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb } } + /** + * Handle ManialinkPageAnswer Callback + * + * @param array $callback + */ public function handleManialinkPageAnswer(array $callback) { $actionId = $callback[1][2]; @@ -357,7 +362,12 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb } } - private function showMapListAuthor($author, $player) { + /** + * Show the Player a List of Maps from the given Author + * @param string $author + * @param Player $player + */ + private function showMapListAuthor($author, Player $player) { $maps = $this->maniaControl->mapManager->getMaps(); $mapList = array(); /** @var Map $map */ @@ -375,7 +385,13 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb $this->maniaControl->mapManager->mapList->showMapList($player, $mapList); } - private function showMapListKarma($best, $player) { + /** + * Show a Karma based MapList + * + * @param bool $best + * @param Player $player + */ + private function showMapListKarma($best, Player $player) { /** @var \MCTeam\KarmaPlugin $karmaPlugin */ $karmaPlugin = $this->maniaControl->pluginManager->getPlugin(MapList::DEFAULT_KARMA_PLUGIN); if($karmaPlugin) { @@ -418,15 +434,28 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb } } + /** + * Helper Function to sort Maps by Karma + * + * @param Map $a + * @param Map $b + * @return mixed + */ private function sortByKarma($a, $b) { - return $a->karma - $b->karma; + return ($a->karma - $b->karma); } - private function showMapListDate($newest, $player) { + /** + * Show a Date based MapList + * + * @param bool $newest + * @param Player $player + */ + private function showMapListDate($newest, Player $player) { $maps = $this->maniaControl->mapManager->getMaps(); usort($maps, function($a, $b) { - return $a->index - $b->index; + return ($a->index - $b->index); }); if($newest) { diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 03f9be30..10330158 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -170,14 +170,17 @@ class MapManager implements CallbackListener { } /** - * Updates the Timestamp of a map + * Update the Timestamp of a Map * - * @param $map + * @param string $uid * @return bool */ private function updateMapTimestamp($uid) { $mysqli = $this->maniaControl->database->mysqli; - $mapQuery = "UPDATE `" . self::TABLE_MAPS . "` SET mxid = 0, changed = NOW() WHERE 'uid' = ?"; + $mapQuery = "UPDATE `" . self::TABLE_MAPS . "` SET + mxid = 0, + changed = NOW() + WHERE 'uid' = ?"; $mapStatement = $mysqli->prepare($mapQuery); if ($mysqli->error) { @@ -196,17 +199,16 @@ class MapManager implements CallbackListener { } /** - * Updates a Map from Mania Exchange + * Update a Map from Mania Exchange * * @param Player $admin - * @param $mxId - * @param $uid + * @param string $uid */ public function updateMap(Player $admin, $uid) { $this->updateMapTimestamp($uid); if (!isset($uid) || !isset($this->maps[$uid])) { - trigger_error("Error while updating Map, unkown UID: " . $uid); + trigger_error("Error while updating Map, unknown UID: " . $uid); $this->maniaControl->chat->sendError("Error while updating Map.", $admin->login); return; } @@ -560,6 +562,8 @@ class MapManager implements CallbackListener { /** * Get all Maps * + * @param int $offset + * @param int $length * @return array */ public function getMaps($offset = null, $length = null) { diff --git a/application/core/Players/PlayerActions.php b/application/core/Players/PlayerActions.php index cef6d7ff..eaad80a9 100644 --- a/application/core/Players/PlayerActions.php +++ b/application/core/Players/PlayerActions.php @@ -203,7 +203,6 @@ class PlayerActions { * * @param string $adminLogin * @param string $targetLogin - * @param int $spectatorState */ public function unMutePlayer($adminLogin, $targetLogin) { $admin = $this->maniaControl->playerManager->getPlayer($adminLogin); @@ -236,7 +235,6 @@ class PlayerActions { * * @param string $adminLogin * @param string $targetLogin - * @param int $spectatorState */ public function mutePlayer($adminLogin, $targetLogin) { $admin = $this->maniaControl->playerManager->getPlayer($adminLogin); diff --git a/application/core/Players/PlayerCommands.php b/application/core/Players/PlayerCommands.php index 93fcc185..3642aeea 100644 --- a/application/core/Players/PlayerCommands.php +++ b/application/core/Players/PlayerCommands.php @@ -167,8 +167,8 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca * @param array $chatCallback * @param Player $player */ - public function command_Warn(array $chat, Player $player) { - $params = explode(' ', $chat[1][2], 3); + public function command_Warn(array $chatCallback, Player $player) { + $params = explode(' ', $chatCallback[1][2], 3); if (count($params) <= 1) { $this->maniaControl->chat->sendUsageInfo("No Login given! Example: '//kick login'", $player->login); return; diff --git a/application/core/Players/PlayerDataManager.php b/application/core/Players/PlayerDataManager.php index eedd87af..23fd34e6 100644 --- a/application/core/Players/PlayerDataManager.php +++ b/application/core/Players/PlayerDataManager.php @@ -116,16 +116,16 @@ class PlayerDataManager { /** * Gets the Player Data * - * @param $object - * @param $dataName + * @param mixed $object + * @param string $dataName * @param Player $player - * @param $serverIndex + * @param int $serverIndex * @return mixed|null */ - public function getPlayerData($object, $statName, Player $player, $serverIndex = -1) { + public function getPlayerData($object, $dataName, Player $player, $serverIndex = -1) { $className = $this->getClassName($object); - $meta = $this->metaData[$className . $statName]; + $meta = $this->metaData[$className . $dataName]; //Check if data is already in the ram if (isset($this->storedData[$player->index])) { @@ -152,7 +152,7 @@ class PlayerDataManager { } $dataStatement->store_result(); if ($dataStatement->num_rows <= 0) { - $this->setPlayerData($object, $statName, $player, $meta->defaultValue, $serverIndex); + $this->setPlayerData($object, $dataName, $player, $meta->defaultValue, $serverIndex); return $meta->default; } $dataStatement->bind_result($value); @@ -172,11 +172,11 @@ class PlayerDataManager { /** * Set a PlayerData to a specific defined statMetaData * - * @param $object - * @param $statName + * @param mixed $object + * @param string $dataName * @param Player $player - * @param $value - * @param $serverIndex (let it empty if its global) + * @param mixed $value + * @param int $serverIndex (let it empty if its global) * @return bool */ public function setPlayerData($object, $dataName, Player $player, $value, $serverIndex = -1) { @@ -225,7 +225,8 @@ class PlayerDataManager { /** * Return the Id of the MetaData * - * @param $statName + * @param string $className + * @param string $statName * @return int */ private function getMetaDataId($className, $statName) { diff --git a/application/core/Players/PlayerDetailed.php b/application/core/Players/PlayerDetailed.php index 4b9ab3b0..41415d7d 100644 --- a/application/core/Players/PlayerDetailed.php +++ b/application/core/Players/PlayerDetailed.php @@ -14,6 +14,7 @@ use ManiaControl\Formatter; use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkManager; use ManiaControl\Statistics\StatisticManager; +use Maniaplanet\DedicatedServer\Structures\Player; /** * Player Detailed Page @@ -48,8 +49,14 @@ class PlayerDetailed { $this->quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowSubStyle(); } - + /** + * Show a Frame with detailed Information about the Target Player + * + * @param Player $player + * @param string $targetLogin + */ public function showPlayerDetailed(Player $player, $targetLogin) { + /** @var Player $target */ $target = $this->maniaControl->playerManager->getPlayer($targetLogin); //Create ManiaLink @@ -209,7 +216,13 @@ class PlayerDetailed { $this->maniaControl->manialinkManager->displayWidget($maniaLink, $player, 'PlayerDetailed'); } - public function statisticsFrame($player) { + /** + * Build a Frame with Statistics about the given Player + * + * @param Player $player + * @return Frame + */ + public function statisticsFrame(Player $player) { $frame = new Frame(); $playerStats = $this->maniaControl->statisticManager->getAllPlayerStats($player); diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index e2099acd..70a38009 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -2,6 +2,7 @@ namespace ManiaControl\Players; +use Maniaplanet\DedicatedServer\Structures\Player; use MCTeam\CustomVotesPlugin; use FML\Controls\Control; use FML\Controls\Frame; @@ -412,10 +413,11 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer /** * Extra window with special actions on players like warn,kick, ban, authorization levels... * - * @param $login + * @param Player $admin + * @param string $login * @return Frame */ - public function showAdvancedPlayerWidget($admin, $login) { + public function showAdvancedPlayerWidget(Player $admin, $login) { $player = $this->maniaControl->playerManager->getPlayer($login); $width = $this->maniaControl->manialinkManager->styleManager->getListWidgetsWidth(); $height = $this->maniaControl->manialinkManager->styleManager->getListWidgetsHeight(); diff --git a/application/core/Players/PlayerManager.php b/application/core/Players/PlayerManager.php index eaa31b6b..4f59cfa0 100644 --- a/application/core/Players/PlayerManager.php +++ b/application/core/Players/PlayerManager.php @@ -306,7 +306,7 @@ class PlayerManager implements CallbackListener, TimerListener { * * @param string $login * @param bool $connectedPlayersOnly - * @return Player|null + * @return Player */ public function getPlayer($login, $connectedPlayersOnly = false) { if (!isset($this->players[$login])) { @@ -390,10 +390,10 @@ class PlayerManager implements CallbackListener, TimerListener { /** - * Get's a Player out of the database + * Get a Player from the Database * - * @param $playerIndex - * @return Player $player + * @param string $playerLogin + * @return Player */ private function getPlayerFromDatabaseByLogin($playerLogin) { $mysqli = $this->maniaControl->database->mysqli; diff --git a/application/core/Plugins/PluginInstallMenu.php b/application/core/Plugins/PluginInstallMenu.php index c21297d8..650f07da 100644 --- a/application/core/Plugins/PluginInstallMenu.php +++ b/application/core/Plugins/PluginInstallMenu.php @@ -58,6 +58,7 @@ class PluginInstallMenu implements CallbackListener, ConfiguratorMenu, Manialink * @param float $width * @param float $height * @param Script $script + * @param Player $player * @return \FML\Controls\Frame */ public function getMenu($width, $height, Script $script, Player $player) { diff --git a/application/core/Plugins/PluginManager.php b/application/core/Plugins/PluginManager.php index c4c2ac7d..1378aed8 100644 --- a/application/core/Plugins/PluginManager.php +++ b/application/core/Plugins/PluginManager.php @@ -396,7 +396,7 @@ class PluginManager { /** * Get the Class of the Object * - * @param mixed $pluginClass + * @param mixed $object * @return string */ private static function getClass($object) { diff --git a/application/core/Server/ServerCommands.php b/application/core/Server/ServerCommands.php index 4eba6a2b..5465eaa9 100644 --- a/application/core/Server/ServerCommands.php +++ b/application/core/Server/ServerCommands.php @@ -190,9 +190,10 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage } /** - * Breaks the current game + * Pause the current game * * @param array $callback + * @param Player $player */ public function setPause(array $callback, Player $player) { if (!$this->maniaControl->authenticationManager->checkPermission($player, self::SETTING_PERMISSION_SET_PAUSE)) { diff --git a/application/core/Settings/SettingManager.php b/application/core/Settings/SettingManager.php index 2df82e4c..e8c5ce6a 100644 --- a/application/core/Settings/SettingManager.php +++ b/application/core/Settings/SettingManager.php @@ -440,7 +440,8 @@ class SettingManager implements CallbackListener { /** * Get all Setting Classes - * + * + * @param bool $hidePluginClasses * @return array */ public function getSettingClasses($hidePluginClasses = false) { diff --git a/application/core/Statistics/SimpleStatsList.php b/application/core/Statistics/SimpleStatsList.php index 44c7c961..843af240 100644 --- a/application/core/Statistics/SimpleStatsList.php +++ b/application/core/Statistics/SimpleStatsList.php @@ -113,9 +113,10 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener, /** - * Show the PlayerList Widget to the Player + * Show the StatsList Widget to the Player * * @param Player $player + * @param string $order */ public function showStatsList(Player $player, $order = PlayerManager::STAT_SERVERTIME) { $height = $this->maniaControl->manialinkManager->styleManager->getListWidgetsHeight(); diff --git a/application/core/Statistics/StatisticCollector.php b/application/core/Statistics/StatisticCollector.php index aa26488c..61227105 100644 --- a/application/core/Statistics/StatisticCollector.php +++ b/application/core/Statistics/StatisticCollector.php @@ -122,9 +122,10 @@ class StatisticCollector implements CallbackListener { } /** - * Handle Player Shoots + * Handle Player Shots * - * @param $login + * @param string $login + * @param int $weaponNumber */ private function handleOnShoot($login, $weaponNumber) { if (!isset($this->onShootArray[$login])) { @@ -165,9 +166,10 @@ class StatisticCollector implements CallbackListener { } /** - * Gets the Weapon stat + * Get the Weapon stat * - * @param $weaponNumber + * @param int $weaponNumber + * @param bool $shot * @return string */ private function getWeaponStat($weaponNumber, $shot = true) { diff --git a/application/core/Update/PluginUpdateData.php b/application/core/Update/PluginUpdateData.php index 84fb14ae..9d1dc618 100644 --- a/application/core/Update/PluginUpdateData.php +++ b/application/core/Update/PluginUpdateData.php @@ -41,7 +41,7 @@ class PluginUpdateData { } /** - * Check if the Plugin Update Data is newer than the given Plugin Versin + * Check if the Plugin Update Data is newer than the given Plugin Version * * @param float $version * @return bool diff --git a/application/core/Update/PluginUpdateManager.php b/application/core/Update/PluginUpdateManager.php index 2e028235..487cfc12 100644 --- a/application/core/Update/PluginUpdateManager.php +++ b/application/core/Update/PluginUpdateManager.php @@ -322,6 +322,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis * * @param PluginUpdateData $pluginUpdateData * @param Player $player + * @param bool $update */ private function installPlugin(PluginUpdateData $pluginUpdateData, Player $player = null, $update = false) { $self = $this; diff --git a/application/core/Update/UpdateManager.php b/application/core/Update/UpdateManager.php index 3719deb1..8d81d322 100644 --- a/application/core/Update/UpdateManager.php +++ b/application/core/Update/UpdateManager.php @@ -453,6 +453,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener * Check if ManiaControl is running the Nightly Update Channel * * @param string $updateChannel + * @return bool */ public function isNightlyUpdateChannel($updateChannel = null) { if (!$updateChannel) { diff --git a/application/plugins/Donations.php b/application/plugins/Donations.php index f9e0fd76..1aacd965 100644 --- a/application/plugins/Donations.php +++ b/application/plugins/Donations.php @@ -70,7 +70,6 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { //do nothing } - /** * @see \ManiaControl\Plugins\Plugin::load() */ @@ -153,9 +152,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { } /** - * Handle ManiaControl OnStartup - * - * @param array $callback + * Display the Widget */ public function displayWidget() { if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED)) { @@ -323,12 +320,15 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { } /** - * Handles a Player Donate + * Handle a Player Donation * * @param Player $player - * @param $value + * @param int $amount + * @param string $receiver + * @param string $receiverName + * @return bool */ - private function handleDonation(Player $player, $amount, $receiver = '', $receiverName = false) { + private function handleDonation(Player $player, $amount, $receiver = '', $receiverName = null) { if (!$receiverName) { $serverName = $this->maniaControl->client->getServerName(); diff --git a/application/plugins/WidgetPlugin.php b/application/plugins/WidgetPlugin.php index 6aacbbcf..54a13438 100644 --- a/application/plugins/WidgetPlugin.php +++ b/application/plugins/WidgetPlugin.php @@ -149,9 +149,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { } /** - * Displays the Widgets onLoad - * - * @param array $callback + * Display the Widgets */ private function displayWidgets() { // Display Map Widget @@ -168,11 +166,11 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { } /** - * Displays the Map Widget + * Display the Map Widget * - * @param String $login + * @param string $login */ - public function displayMapWidget($login = false) { + public function displayMapWidget($login = null) { $pos_x = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_POSX); $pos_y = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_POSY); $width = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_WIDTH); @@ -280,11 +278,11 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { } /** - * Displays the Server Info Widget + * Display the Server Info Widget * - * @param String $login + * @param string $login */ - public function displayServerInfoWidget($login = false) { + public function displayServerInfoWidget($login = null) { $pos_x = $this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_POSX); $pos_y = $this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_POSY); $width = $this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_WIDTH);