various phpdoc improvements and additions

added some getter methods for properties
This commit is contained in:
Steffen Schröder
2014-07-25 16:28:47 +02:00
parent 29f89ec15f
commit 002b537b47
38 changed files with 381 additions and 188 deletions

View File

@ -41,7 +41,7 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
const COMMAND_FORCE_WARMUP = 'Command_ForceWarmUp';
/*
* Private Properties
* Private properties
*/
private $maniaControl = null;
private $serverShutdownTime = -1;

View File

@ -11,7 +11,7 @@ namespace ManiaControl\Server;
*/
class Config {
/*
* Public Properties
* Public properties
*/
public $id = null;
public $host = null;
@ -20,7 +20,7 @@ class Config {
public $pass = null;
/**
* Create a new Server Config Instance
* Create a new server config instance
*
* @param mixed $id
* @param mixed $host

View File

@ -16,12 +16,12 @@ use ManiaControl\ManiaControl;
*/
class Directory implements CallbackListener {
/**
* Private Properties
* Private properties
*/
private $maniaControl = null;
/**
* Create new Server Directory Object
* Create new server directory instance
*
* @param ManiaControl $maniaControl
*/
@ -75,6 +75,15 @@ class Directory implements CallbackListener {
return $this->getGameDataFolder() . '..' . DIRECTORY_SEPARATOR . 'Logs' . DIRECTORY_SEPARATOR;
}
/**
* Retrieve the Game Data Folder Path
*
* @return string
*/
public function getGameDataFolder() {
return $this->maniaControl->client->gameDataDirectory();
}
/**
* @return bool
*/
@ -90,13 +99,4 @@ class Directory implements CallbackListener {
public function getCacheFolder() {
return $this->getGameDataFolder() . '..' . DIRECTORY_SEPARATOR . 'CommonData' . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
}
/**
* Retrieve the Game Data Folder Path
*
* @return string
*/
public function getGameDataFolder() {
return $this->maniaControl->client->gameDataDirectory();
}
}

View File

@ -17,14 +17,14 @@ use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
*/
class RankingManager implements CallbackListener {
/*
* Private Properties
* Private properties
*/
private $rankings = array();
/**
* Construct player manager
* Construct a new ranking manager instance
*
* @param \ManiaControl\ManiaControl $maniaControl
* @param ManiaControl $maniaControl
*/
public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
@ -37,7 +37,7 @@ class RankingManager implements CallbackListener {
}
/**
* Initialize the Rankings (never call this Method)
* Initialize the Rankings (never call this Method)
*/
public function onInit() {
try {
@ -124,4 +124,4 @@ class RankingManager implements CallbackListener {
public function getPlayerRanking() {
//TODO complete this
}
}
}

View File

@ -15,15 +15,11 @@ class ScriptManager {
/*
* Private Properties
*/
public $maniaControl = null;
/*
* Private Properties
*/
private $maniaControl = null;
private $isScriptMode = null;
/**
* Construct a new Script Manager
* Construct a new script manager instance
*
* @param ManiaControl $maniaControl
*/
@ -32,7 +28,7 @@ class ScriptManager {
}
/**
* Enable Script Callbacks
* Enable script callbacks
*
* @param bool $enable
* @return bool
@ -56,7 +52,7 @@ class ScriptManager {
}
/**
* Check if the Server is running in Script Mode
* Check whether the Server is running in Script Mode
*
* @return bool
*/

View File

@ -10,7 +10,7 @@ use ManiaControl\Utils\CommandLineHelper;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/**
* Class providing Access to the connected ManiaPlanet Server
* Class providing access to the connected ManiaPlanet Server
*
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014 ManiaControl Team
@ -24,7 +24,7 @@ class Server implements CallbackListener {
const CB_TEAM_MODE_CHANGED = 'Server.TeamModeChanged';
/*
* Public Properties
* Public properties
*/
/** @var Config $config */
public $config = null;
@ -34,10 +34,15 @@ class Server implements CallbackListener {
public $p2pPort = -1;
public $login = null;
public $titleId = null;
/** @var Directory $directory */
public $directory = null;
/** @var Commands $commands */
public $commands = null;
/** @var UsageReporter $usageReporter */
public $usageReporter = null;
/** @var RankingManager $rankingManager */
public $rankingManager = null;
/** @var ScriptManager $scriptManager */
public $scriptManager = null;
/*
@ -92,6 +97,51 @@ class Server implements CallbackListener {
return true;
}
/**
* Return the server config
*
* @return Config
*/
public function getConfig() {
return $this->config;
}
/**
* Return the server directory
*
* @return Directory
*/
public function getDirectory() {
return $this->directory;
}
/**
* Return the server commands
*
* @return Commands
*/
public function getCommands() {
return $this->commands;
}
/**
* Return the usage reporter
*
* @return UsageReporter
*/
public function getUsageReporter() {
return $this->usageReporter;
}
/**
* Return the script manager
*
* @return ScriptManager
*/
public function getScriptManager() {
return $this->scriptManager;
}
/**
* Load the Server Configuration from the Config XML
*/