diff --git a/application/core/Bills/BillManager.php b/application/core/Bills/BillManager.php index 532c6fbb..f07b0785 100644 --- a/application/core/Bills/BillManager.php +++ b/application/core/Bills/BillManager.php @@ -42,27 +42,21 @@ class BillManager implements CallbackListener { } /** - * send a Bill to a Player + * Send a Bill to a Player * - * @param $function - * @param Player $player - * @param $amount - * @param $message - * @param bool $receiver + * @param callable $function + * @param Player $player + * @param int $amount + * @param string $message + * @param string $receiver * @return bool */ - public function sendBill($function, Player $player, $amount, $message, $receiver = false) { + public function sendBill($function, Player $player, $amount, $message, $receiver = '') { if (!is_callable($function)) { - trigger_error("Function is not callable"); + trigger_error("Function is not callable!"); return false; } - - if (!$receiver) { - $bill = $this->maniaControl->client->sendBill($player->login, $amount, $message); - } else { - $bill = $this->maniaControl->client->sendBill($player->login, $amount, $message, $receiver); - } - + $bill = $this->maniaControl->client->sendBill($player->login, $amount, $message, $receiver); $this->openBills[$bill] = new BillData($function, $player, $amount); return true; } diff --git a/application/core/Database/Database.php b/application/core/Database/Database.php index 4e0e5337..96aa49f8 100644 --- a/application/core/Database/Database.php +++ b/application/core/Database/Database.php @@ -25,7 +25,9 @@ class Database implements TimerListener { private $maniaControl = null; /** - * Construct database connection + * Construct a new Database Connection + * + * @param ManiaControl $maniaControl */ public function __construct(ManiaControl $maniaControl) { $this->maniaControl = $maniaControl; diff --git a/application/core/ErrorHandler.php b/application/core/ErrorHandler.php index 3f3d35d2..514d29a2 100644 --- a/application/core/ErrorHandler.php +++ b/application/core/ErrorHandler.php @@ -218,6 +218,7 @@ class ErrorHandler { /** * Parse the Debug Backtrace into a String for the Error Report * + * @param array $backtrace * @return string */ private function parseBackTrace(array $backtrace) { diff --git a/application/core/Server/ScriptManager.php b/application/core/Server/ScriptManager.php index 3df378e8..9b4b21ae 100644 --- a/application/core/Server/ScriptManager.php +++ b/application/core/Server/ScriptManager.php @@ -3,6 +3,7 @@ namespace ManiaControl\Server; use ManiaControl\ManiaControl; +use Maniaplanet\DedicatedServer\Xmlrpc\Exception; use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException; /** @@ -45,16 +46,17 @@ class ScriptManager { } $scriptSettings['S_UseScriptCallbacks'] = (bool)$enable; + $actionName = ($enable ? 'en' : 'dis'); try { $this->maniaControl->client->setModeScriptSettings($scriptSettings); } catch (Exception $e) { // TODO temp added 19.04.2014 $this->maniaControl->errorHandler->handleException($e, false); - trigger_error("Couldn't set mode script settings to enable script callbacks. " . $e->getMessage()); + trigger_error("Couldn't set Mode Script Settings to {$actionName}able Script Sallbacks. " . $e->getMessage()); return false; } - $this->maniaControl->log('Script Callbacks successfully enabled!'); - return false; + $this->maniaControl->log("Script Callbacks successfully {$actionName}abled!"); + return true; } }