fixed & improved phpdoc

This commit is contained in:
Steffen Schröder 2014-05-09 17:30:31 +02:00
parent 4a31d638bd
commit 49f3953abf
4 changed files with 18 additions and 19 deletions

View File

@ -42,27 +42,21 @@ class BillManager implements CallbackListener {
} }
/** /**
* send a Bill to a Player * Send a Bill to a Player
* *
* @param $function * @param callable $function
* @param Player $player * @param Player $player
* @param $amount * @param int $amount
* @param $message * @param string $message
* @param bool $receiver * @param string $receiver
* @return bool * @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)) { if (!is_callable($function)) {
trigger_error("Function is not callable"); trigger_error("Function is not callable!");
return false; 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); $this->openBills[$bill] = new BillData($function, $player, $amount);
return true; return true;
} }

View File

@ -25,7 +25,9 @@ class Database implements TimerListener {
private $maniaControl = null; private $maniaControl = null;
/** /**
* Construct database connection * Construct a new Database Connection
*
* @param ManiaControl $maniaControl
*/ */
public function __construct(ManiaControl $maniaControl) { public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl; $this->maniaControl = $maniaControl;

View File

@ -218,6 +218,7 @@ class ErrorHandler {
/** /**
* Parse the Debug Backtrace into a String for the Error Report * Parse the Debug Backtrace into a String for the Error Report
* *
* @param array $backtrace
* @return string * @return string
*/ */
private function parseBackTrace(array $backtrace) { private function parseBackTrace(array $backtrace) {

View File

@ -3,6 +3,7 @@
namespace ManiaControl\Server; namespace ManiaControl\Server;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException; use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException;
/** /**
@ -45,16 +46,17 @@ class ScriptManager {
} }
$scriptSettings['S_UseScriptCallbacks'] = (bool)$enable; $scriptSettings['S_UseScriptCallbacks'] = (bool)$enable;
$actionName = ($enable ? 'en' : 'dis');
try { try {
$this->maniaControl->client->setModeScriptSettings($scriptSettings); $this->maniaControl->client->setModeScriptSettings($scriptSettings);
} catch (Exception $e) { } catch (Exception $e) {
// TODO temp added 19.04.2014 // TODO temp added 19.04.2014
$this->maniaControl->errorHandler->handleException($e, false); $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; return false;
} }
$this->maniaControl->log('Script Callbacks successfully enabled!'); $this->maniaControl->log("Script Callbacks successfully {$actionName}abled!");
return false; return true;
} }
} }