From d04a6b71feef61e7221ac1e310788a9dbfe35e2d Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 7 Apr 2017 23:38:18 +0200 Subject: [PATCH] added some api / internal tags --- core/Admin/ActionsMenu.php | 14 ++++++++++++-- core/Admin/AdminLists.php | 13 ++++++++++--- core/Admin/AuthCommands.php | 4 ++++ core/Admin/AuthenticationManager.php | 14 ++++++++++++++ core/Bills/BillData.php | 2 ++ core/Bills/BillManager.php | 9 +++++++-- 6 files changed, 49 insertions(+), 7 deletions(-) diff --git a/core/Admin/ActionsMenu.php b/core/Admin/ActionsMenu.php index 06c2b06c..a75d8dc5 100644 --- a/core/Admin/ActionsMenu.php +++ b/core/Admin/ActionsMenu.php @@ -20,13 +20,14 @@ use ManiaControl\Players\PlayerManager; /** * Class managing Actions Menus * + * @api * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, UsageInformationAble { use UsageInformationTrait; - + /* * Constants */ @@ -68,6 +69,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Add a new Menu Item * + * @api * @param Control $control * @param bool $playerAction * @param int $order @@ -84,6 +86,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Add a new Player Menu Item * + * @api * @param Control $control * @param int $order * @param string $description @@ -99,6 +102,8 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Build and show the menus to everyone (if a menu get made after the init) + * + * @api */ public function rebuildAndShowMenu() { if (!$this->initCompleted) { @@ -173,7 +178,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag $popoutFrame->addChild($backgroundQuad); $backgroundQuad->setHorizontalAlign($backgroundQuad::RIGHT); $backgroundQuad->setStyles($quadStyle, $quadSubstyle); - $backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.05 + 2 , $itemSize * $itemMarginFactorY); + $backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.05 + 2, $itemSize * $itemMarginFactorY); $itemQuad->addToggleFeature($popoutFrame); @@ -266,6 +271,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Add a new Admin Menu Item * + * @api * @param Control $control * @param int $order * @param string $description @@ -282,6 +288,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Removes a Menu Item * + * @api * @param int $order * @param bool $playerAction */ @@ -300,6 +307,8 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Handle ManiaControl AfterInit callback + * + * @internal */ public function handleAfterInit() { $this->initCompleted = true; @@ -309,6 +318,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag /** * Handle PlayerJoined callback * + * @internal * @param Player $player */ public function handlePlayerJoined(Player $player) { diff --git a/core/Admin/AdminLists.php b/core/Admin/AdminLists.php index c49c9fee..f97fd805 100644 --- a/core/Admin/AdminLists.php +++ b/core/Admin/AdminLists.php @@ -24,6 +24,7 @@ use ManiaControl\Players\Player; /** * Widget Class listing Authorized Players * + * @api * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 @@ -71,6 +72,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage /** * Open Admin List Action * + * @internal * @param array $callback * @param Player $player */ @@ -81,6 +83,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage /** * Show the Admin List * + * @api * @param Player $player */ public function showAdminLists(Player $player) { @@ -149,9 +152,9 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage } $labelLine = new LabelLine($playerFrame); - $labelLine->addLabelEntryText($index, $posX + 5,13); - $labelLine->addLabelEntryText($admin->nickname,$posX + 18,52); - $labelLine->addLabelEntryText($admin->login,$posX + 70,48); + $labelLine->addLabelEntryText($index, $posX + 5, 13); + $labelLine->addLabelEntryText($admin->nickname, $posX + 18, 52); + $labelLine->addLabelEntryText($admin->login, $posX + 70, 48); $labelLine->render(); // Level Quad @@ -212,6 +215,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage /** * Called on ManialinkPageAnswer * + * @internal * @param array $callback */ public function handleManialinkPageAnswer(array $callback) { @@ -235,6 +239,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage /** * Reopen the widget on Map Begin, MapListChanged, etc. * + * @internal * @param Player $player */ public function updateWidget(Player $player) { @@ -253,6 +258,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage /** * Closes the widget * + * @internal * @param Player $player */ public function closeWidget(Player $player) { @@ -262,6 +268,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage /** * Unset the player if he opened another Main Widget * + * @internal * @param Player $player * @param string $openedWidget */ diff --git a/core/Admin/AuthCommands.php b/core/Admin/AuthCommands.php index 49618967..785e6d52 100644 --- a/core/Admin/AuthCommands.php +++ b/core/Admin/AuthCommands.php @@ -43,6 +43,7 @@ class AuthCommands implements CommandListener, UsageInformationAble { /** * Handle //addsuperadmin command * + * @internal * @param array $chatCallback * @param Player $player */ @@ -85,6 +86,7 @@ class AuthCommands implements CommandListener, UsageInformationAble { /** * Handle //addadmin command * + * @internal * @param array $chatCallback * @param Player $player */ @@ -127,6 +129,7 @@ class AuthCommands implements CommandListener, UsageInformationAble { /** * Handle //addmod command * + * @internal * @param array $chatCallback * @param Player $player */ @@ -170,6 +173,7 @@ class AuthCommands implements CommandListener, UsageInformationAble { /** * Handle //removerights command * + * @internal * @param array $chatCallback * @param Player $player */ diff --git a/core/Admin/AuthenticationManager.php b/core/Admin/AuthenticationManager.php index 343d4417..abb8d587 100644 --- a/core/Admin/AuthenticationManager.php +++ b/core/Admin/AuthenticationManager.php @@ -19,6 +19,7 @@ use ManiaControl\Settings\Setting; /** * Class managing Authentication Levels * + * @api * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 @@ -117,6 +118,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Get Name of the Authentication Level from Level Int * + * @api * @param mixed $authLevelInt * @return string */ @@ -138,6 +140,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Get the Authentication Level Int from the given Param * + * @api * @param mixed $authLevelParam * @return int */ @@ -154,6 +157,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Get Authentication Level Int from Level Name * + * @api * @param string $authLevelName * @return int */ @@ -175,6 +179,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Get the Abbreviation of the Authentication Level from Level Int * + * @api * @param mixed $authLevelInt * @return string */ @@ -195,6 +200,8 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Handle ManiaControl OnInit Callback + * + * @internal */ public function handleOnInit() { $this->updateMasterAdmins(); @@ -265,6 +272,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Get all connected Players with at least the given Auth Level * + * @api * @param int $authLevel * @return Player[] */ @@ -282,6 +290,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Check whether the Player has enough Rights * + * @api * @param Player $player * @param int|Setting $neededAuthLevel * @return bool @@ -296,6 +305,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Get a List of all Admins * + * @api * @param int $authLevel * @return Player[] */ @@ -323,6 +333,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Grant the Auth Level to the Player * + * @api * @param Player $player * @param int $authLevel * @return bool @@ -368,6 +379,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Send an Error Message to the Player * + * @api * @param Player $player * @return bool */ @@ -381,6 +393,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Checks the permission by a right name * + * @api * @param Player $player * @param $rightName * @return bool @@ -393,6 +406,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica /** * Define a Minimum Right Level needed for an Action * + * @api * @param string $rightName * @param int $authLevelNeeded */ diff --git a/core/Bills/BillData.php b/core/Bills/BillData.php index 25b0c94a..686e990c 100644 --- a/core/Bills/BillData.php +++ b/core/Bills/BillData.php @@ -7,6 +7,7 @@ use ManiaControl\Players\Player; /** * ManiaControl BillData Structure * + * @api * @author ManiaControl Team * @copyright 2014-2015 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 @@ -27,6 +28,7 @@ class BillData { /** * Construct new Bill Data Model * + * @api * @param string $class * @param callable $function * @param Player|string $player diff --git a/core/Bills/BillManager.php b/core/Bills/BillManager.php index 1bbe9d7c..d459e513 100644 --- a/core/Bills/BillManager.php +++ b/core/Bills/BillManager.php @@ -14,13 +14,14 @@ use Maniaplanet\DedicatedServer\Structures\Bill; /** * ManiaControl Bill Manager Class * + * @api * @author ManiaControl Team * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ class BillManager implements CallbackListener, UsageInformationAble { use UsageInformationTrait; - + /* * Constants */ @@ -54,6 +55,7 @@ class BillManager implements CallbackListener, UsageInformationAble { /** * Send a bill to a player * + * @api * @param callable $function * @param Player $player * @param int $amount @@ -80,6 +82,7 @@ class BillManager implements CallbackListener, UsageInformationAble { /** * Send planets from the server to a player * + * @api * @param callable $function * @param string $receiverLogin * @param int $amount @@ -104,13 +107,14 @@ class BillManager implements CallbackListener, UsageInformationAble { /** * Handle bill updated callback * + * @internal * @param array $callback * @return bool */ public function handleBillUpdated(array $callback) { $billId = $callback[1][0]; if (!isset($this->openBills[$billId])) { - return; + return null; } $billData = $this->openBills[$billId]; @@ -142,5 +146,6 @@ class BillManager implements CallbackListener, UsageInformationAble { unset($this->openBills[$billId]); break; } + return null; } }