various phpdoc improvements and additions
added some getter methods for properties
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
|
||||
namespace ManiaControl\Bills;
|
||||
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
/**
|
||||
* ManiaControl BillData Structure
|
||||
*
|
||||
@ -10,8 +12,9 @@ namespace ManiaControl\Bills;
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class BillData {
|
||||
|
||||
/*
|
||||
* Public Properties
|
||||
* Public properties
|
||||
*/
|
||||
public $function = null;
|
||||
public $pay = false;
|
||||
@ -21,13 +24,13 @@ class BillData {
|
||||
public $creationTime = -1;
|
||||
|
||||
/**
|
||||
* Construct new BillData
|
||||
* Construct new Bill Data Model
|
||||
*
|
||||
* @param mixed $function
|
||||
* @param Player /string $player
|
||||
* @param int $amount
|
||||
* @param bool $pay
|
||||
* @param string $receiverLogin
|
||||
* @param mixed $function
|
||||
* @param Player|string $player
|
||||
* @param int $amount
|
||||
* @param bool $pay
|
||||
* @param string $receiverLogin
|
||||
*/
|
||||
public function __construct($function, $player, $amount, $pay = false, $receiverLogin = null) {
|
||||
$this->function = $function;
|
||||
@ -37,5 +40,4 @@ class BillData {
|
||||
$this->receiverLogin = $receiverLogin;
|
||||
$this->creationTime = time();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ use ManiaControl\Players\Player;
|
||||
use Maniaplanet\DedicatedServer\Structures\Bill;
|
||||
|
||||
/**
|
||||
* ManiaControl Bill-Manager
|
||||
* ManiaControl Bill Manager Class
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014 ManiaControl Team
|
||||
@ -26,15 +26,15 @@ class BillManager implements CallbackListener {
|
||||
const ERROR_WHILE_TRANSACTION = 5;
|
||||
|
||||
/*
|
||||
* Private Properties
|
||||
* Private properties
|
||||
*/
|
||||
private $maniaControl = null;
|
||||
private $openBills = array();
|
||||
|
||||
/**
|
||||
* Construct a new Bill Manager
|
||||
* Construct a new Bill Manager Instance
|
||||
*
|
||||
* @param \ManiaControl\ManiaControl $maniaControl
|
||||
* @param ManiaControl $maniaControl
|
||||
*/
|
||||
public function __construct(ManiaControl $maniaControl) {
|
||||
$this->maniaControl = $maniaControl;
|
||||
@ -65,13 +65,13 @@ class BillManager implements CallbackListener {
|
||||
* Send Planets from the server to a Player
|
||||
*
|
||||
* @param callable $function
|
||||
* @param string $receiverLogin
|
||||
* @param int $amount
|
||||
* @param string $message
|
||||
* @param string $receiverLogin
|
||||
* @param int $amount
|
||||
* @param string $message
|
||||
* @return bool
|
||||
*/
|
||||
public function sendPlanets(callable $function, $receiverLogin, $amount, $message) {
|
||||
$bill = $this->maniaControl->client->pay($receiverLogin, $amount, $message);
|
||||
$bill = $this->maniaControl->client->pay($receiverLogin, $amount, $message);
|
||||
$this->openBills[$bill] = new BillData($function, $receiverLogin, $amount, true);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user