type hints

resolved warnings
This commit is contained in:
Steffen Schröder 2014-05-02 15:35:52 +02:00
parent f9a3c0f72e
commit c059d7316c
6 changed files with 23 additions and 6 deletions

View File

@ -3,6 +3,7 @@
namespace ManiaControl\Commands;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\ManiaLink;
use FML\Script\Features\Paging;
@ -228,7 +229,10 @@ class HelpManager implements CommandListener, CallbackListener {
$array = array($command['Name'] => $x + 5, $command['Description'] => $x + 50);
$labels = $this->maniaControl->manialinkManager->labelLine($playerFrame, $array);
$labels[0]->setWidth(40);
/** @var Label $label */
$label = $labels[0];
$label->setWidth(40);
$y -= 4;
$i++;

View File

@ -234,6 +234,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$pageFrame = null;
$index = 0;
$y = 0;
foreach ($settings as $setting) {
if (!$pageFrame) {
$pageFrame = new Frame();

View File

@ -36,10 +36,18 @@ class Database implements TimerListener {
$user = $this->maniaControl->config->database->xpath('user');
$pass = $this->maniaControl->config->database->xpath('pass');
if (!$host) trigger_error("Invalid database configuration (host).", E_USER_ERROR);
if (!$port) trigger_error("Invalid database configuration (port).", E_USER_ERROR);
if (!$user) trigger_error("Invalid database configuration (user).", E_USER_ERROR);
if (!$pass) trigger_error("Invalid database configuration (pass).", E_USER_ERROR);
if (!$host) {
trigger_error("Invalid database configuration (host).", E_USER_ERROR);
}
if (!$port) {
trigger_error("Invalid database configuration (port).", E_USER_ERROR);
}
if (!$user) {
trigger_error("Invalid database configuration (user).", E_USER_ERROR);
}
if (!$pass) {
trigger_error("Invalid database configuration (pass).", E_USER_ERROR);
}
$host = (string) $host[0];
$port = (int) $port[0];

View File

@ -79,6 +79,7 @@ class ManiaControl implements CommandListener, TimerListener {
public $server = null;
public $settingManager = null;
public $statisticManager = null;
/** @var UpdateManager $updateManager */
public $updateManager = null;
public $errorHandler = null;
public $timerManager = null;

View File

@ -220,7 +220,8 @@ class PluginManager {
continue;
}
array_push($newPluginClasses, $className);
/** @var Plugin $className */
$className::prepare($this->maniaControl);
if ($this->getSavedPluginStatus($className)) {

View File

@ -166,6 +166,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis
if (!isset($pluginsData[$pluginId])) {
continue;
}
/** @var PluginUpdateData $pluginData */
$pluginData = $pluginsData[$pluginId];
$pluginVersion = $pluginClass::getVersion();
if ($pluginData->isNewerThan($pluginVersion)) {
@ -301,6 +302,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis
*/
$pluginId = $pluginClass::getId();
if (isset($pluginsUpdates[$pluginId])) {
/** @var PluginUpdateData $pluginUpdateData */
$pluginUpdateData = $pluginsUpdates[$pluginId];
$pluginVersion = $pluginClass::getVersion();
if ($pluginUpdateData->isNewerThan($pluginVersion)) {