fixed number mismatch declerations

code cleanups
This commit is contained in:
kremsy 2020-04-21 17:57:36 +02:00
parent 06b3893a27
commit f31a1c1782
28 changed files with 121 additions and 146 deletions

View File

@ -3,8 +3,6 @@
namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;
/**

View File

@ -3,7 +3,6 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;

View File

@ -5,8 +5,6 @@ namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\Callbacks\Structures\Common\Models\CommonPlayerScore;
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
use ManiaControl\General\JsonSerializable;
use ManiaControl\General\JsonSerializeTrait;
use ManiaControl\ManiaControl;
/**

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ManiaPlanet;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/**
* Structure Class for the OnArmorEmpty Structure Callback

View File

@ -4,8 +4,8 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\ShootMania\Models\Landmark;
use ManiaControl\Callbacks\Structures\ShootMania\Models\Position;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;

View File

@ -3,8 +3,8 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\ManiaControl;
/**
* Structure Class for the Default Event Structure Callback

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/**
* Structure Class for the OnNearMiss Structure Callback

View File

@ -4,9 +4,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
/**
* Structure Class for the OnPlayerRequestRespawnStructure Structure Callback

View File

@ -5,7 +5,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\CommonScoresStructure;
use ManiaControl\Callbacks\Structures\ShootMania\Models\PlayerScore;
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
use ManiaControl\ManiaControl;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;

View File

@ -3,10 +3,10 @@
namespace ManiaControl\Callbacks\Structures\TrackMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\Callbacks\Structures\ShootMania\CommonDefaultEventStructure;
use ManiaControl\ManiaControl;
/**
* Structure Class for the Default Event Structure Callback

View File

@ -6,7 +6,7 @@ namespace ManiaControl\Callbacks\Structures\TrackMania;
use ManiaControl\Callbacks\Models\RecordCallback;
use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Utils\Formatter;
/**
* Structure Class for the On Respawn Structure Callback

View File

@ -28,7 +28,7 @@ class MXMapInfo {
*
* @param String $prefix MX URL prefix
* @param $mx
* @return MXMapInfo
* @return \ManiaControl\ManiaExchange\MXMapInfo|void
*/
public function __construct($prefix, $mx) {
$this->prefix = $prefix;

View File

@ -12,7 +12,7 @@ use FML\Controls\Quads\Quad_BgRaceScore2;
use FML\Controls\Quads\Quad_Bgs1InRace;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\Script\Features\Paging;
use FML\Script\Script;
use ManiaControl\General\UsageInformationAble;

View File

@ -11,7 +11,6 @@ use FML\Script\Features\Paging;
use FML\Script\Script;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Configurator\ConfiguratorMenu;
use ManiaControl\Files\AsyncHttpRequest;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;

View File

@ -9,14 +9,12 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\Structures\Common\StatusCallbackStructure;
use ManiaControl\Callbacks\Structures\TrackMania\OnPointsRepartitionStructure;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\FaultException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
/**
@ -30,17 +28,17 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
/*
* Constants
*/
const ACTION_SET_PAUSE = 'ServerCommands.SetPause';
const ACTION_EXTEND_WARMUP = 'ServerCommands.ExtendWarmup';
const ACTION_END_WARMUP = 'ServerCommands.EndWarmup';
const ACTION_CANCEL_VOTE = 'ServerCommands.CancelVote';
const CB_VOTE_CANCELLED = 'ServerCommands.VoteCancelled';
const SETTING_PERMISSION_CANCEL_VOTE = 'Cancel Vote';
const SETTING_PERMISSION_SET_PAUSE = 'Set Pause';
const SETTING_PERMISSION_HANDLE_WARMUP = 'Handle Warmup';
const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo';
const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server';
const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings';
const ACTION_SET_PAUSE = 'ServerCommands.SetPause';
const ACTION_EXTEND_WARMUP = 'ServerCommands.ExtendWarmup';
const ACTION_END_WARMUP = 'ServerCommands.EndWarmup';
const ACTION_CANCEL_VOTE = 'ServerCommands.CancelVote';
const CB_VOTE_CANCELLED = 'ServerCommands.VoteCancelled';
const SETTING_PERMISSION_CANCEL_VOTE = 'Cancel Vote';
const SETTING_PERMISSION_SET_PAUSE = 'Set Pause';
const SETTING_PERMISSION_HANDLE_WARMUP = 'Handle Warmup';
const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo';
const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server';
const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings';
/*
* Private properties

View File

@ -11,6 +11,7 @@ use ManiaControl\ManiaControl;
use ManiaControl\Maps\Map;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
//TODO delete this class
/**
* Class managing Rankings
*
@ -109,7 +110,7 @@ class RankingManager implements CallbackListener, UsageInformationAble {
array_multisort($this->rankings, SORT_DESC, SORT_NUMERIC);
//TODO if Local Records activated-> sort asc
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGSUPDATED, $this->getRankings());
//$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGSUPDATED, $this->getRankings());
}
/**
@ -134,7 +135,7 @@ class RankingManager implements CallbackListener, UsageInformationAble {
return $leaders;
}
// FIXME: $leader doesn't exist
array_push($leaders, $leader);
//array_push($leaders, $leader);
$prev = $score;
}
return null;

View File

@ -5,19 +5,19 @@ namespace ManiaControl\Server;
use FML\Components\CheckBox;
use FML\Controls\Entry;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad;
use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Script\Features\Paging;
use FML\Script\Script;
use FML\XmlRpc\UIProperties;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Callbacks\Structures\Common\UIPropertiesBaseStructure;
use ManiaControl\Configurator\Configurator;
use ManiaControl\Configurator\ConfiguratorMenu;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Statistics;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad;
use FML\Controls\Quads\Quad_BgsPlayerCard;
@ -15,7 +15,7 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\LabelLine;
use ManiaControl\Manialinks\ManialinkManager;

View File

@ -225,7 +225,7 @@ abstract class Formatter implements UsageInformationAble {
* Make sure the given Text is encoded in UTF-8
*
* @param string $text
* @return string
* @return array|string
*/
public static function utf8($text) {
if (is_array($text)) {

View File

@ -4,7 +4,6 @@ namespace FML\Controls;
use FML\Script\Features\GraphCurve;
use FML\Script\Features\GraphSettings;
use FML\Script\Features\ScriptFeature;
/**
* Graph Control
@ -14,100 +13,92 @@ use FML\Script\Features\ScriptFeature;
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class Graph extends Control
{
class Graph extends Control {
/**
* @var GraphSettings $graphSettings Graph settings
*/
protected $graphSettings = null;
/**
* @var GraphSettings $graphSettings Graph settings
*/
protected $graphSettings = null;
/**
* @var GraphCurve[] $curves Curves
*/
protected $curves = array();
/**
* @var GraphCurve[] $curves Curves
*/
protected $curves = array();
/**
* Get the graph settings
*
* @api
* @return GraphSettings
*/
public function getSettings()
{
if (!$this->graphSettings) {
$this->createSettings();
}
return $this->graphSettings;
}
/**
* Get the graph settings
*
* @api
* @return GraphSettings
*/
public function getSettings() {
if (!$this->graphSettings) {
$this->createSettings();
}
return $this->graphSettings;
}
/**
* Create new graph settings
*
* @return GraphSettings
*/
protected function createSettings()
{
$this->graphSettings = new GraphSettings($this);
$this->addScriptFeature($this->graphSettings);
return $this->graphSettings;
}
/**
* Create new graph settings
*
* @return GraphSettings
*/
protected function createSettings() {
$this->graphSettings = new GraphSettings($this);
$this->addScriptFeature($this->graphSettings);
return $this->graphSettings;
}
/**
* Get curves
*
* @api
* @return GraphCurve[]
*/
public function getCurves()
{
return $this->curves;
}
/**
* Get curves
*
* @api
* @return GraphCurve[]
*/
public function getCurves() {
return $this->curves;
}
/**
* Add curve
*
* @api
* @param GraphCurve $curve Curve
* @return static
*/
public function addCurve(GraphCurve $curve)
{
$curve->setGraph($this);
$this->addScriptFeature($curve);
array_push($this->curves, $curve);
return $this;
}
/**
* Add curve
*
* @api
* @param GraphCurve $curve Curve
* @return static
*/
public function addCurve(GraphCurve $curve) {
$curve->setGraph($this);
$this->addScriptFeature($curve);
array_push($this->curves, $curve);
return $this;
}
/**
* Add curves
*
* @api
* @param GraphCurve[] $curves Curves
* @return static
*/
public function addCurves(array $curves)
{
foreach ($curves as $curve) {
$this->addCurve($curve);
}
return $this;
}
/**
* Add curves
*
* @api
* @param GraphCurve[] $curves Curves
* @return static
*/
public function addCurves(array $curves) {
foreach ($curves as $curve) {
$this->addCurve($curve);
}
return $this;
}
/**
* @see Control::getTagName()
*/
public function getTagName()
{
return "graph";
}
/**
* @see Control::getTagName()
*/
public function getTagName() {
return "graph";
}
/**
* @see Control::getManiaScriptClass()
*/
public function getManiaScriptClass()
{
return "CMlGraph";
}
/**
* @see Control::getManiaScriptClass()
*/
public function getManiaScriptClass() {
return "CMlGraph";
}
}

View File

@ -2,11 +2,9 @@
namespace React\Socket;
use Evenement\EventEmitterInterface;
use React\Stream\ReadableStreamInterface;
use React\Stream\WritableStreamInterface;
interface ConnectionInterface extends ReadableStreamInterface, WritableStreamInterface
{
public function getRemoteAddress();
interface ConnectionInterface extends ReadableStreamInterface, WritableStreamInterface {
public function getRemoteAddress();
}

View File

@ -1,7 +1,5 @@
<?php
use ManiaControl\ManiaControl;
/**
* PHP Unit Test for Custom UI Manager
*

View File

@ -15,7 +15,6 @@ use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\ManiaLink;
use FML\Script\Features\KeyAction;
use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
@ -37,7 +36,6 @@ use ManiaControl\Settings\SettingManager;
use ManiaControl\Utils\ColorUtil;
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
use Maniaplanet\DedicatedServer\Xmlrpc\ChangeInProgressException;
use Maniaplanet\DedicatedServer\Xmlrpc\FaultException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
@ -163,7 +161,7 @@ class CustomVotesPlugin implements SidebarMenuEntryListener, CommandListener, Ca
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SPECTATOR_ALLOW_START_VOTE, true);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_VOTE_TIME, 40);
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::CUSTOMVOTES_MENU_ID,$this,'showIcon');
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::CUSTOMVOTES_MENU_ID, $this, 'showIcon');
//Define Votes
$this->defineVote("teambalance", "Vote for Team Balance");
$this->defineVote("skipmap", "Vote for Skip Map")->setStopCallback(Callbacks::ENDMAP);

View File

@ -10,7 +10,6 @@ use FML\Controls\Quads\Quad_BgRaceScore2;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\ManiaLink;
use FML\Script\Features\Paging;
use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Bills\BillManager;
use ManiaControl\Callbacks\CallbackListener;
@ -120,7 +119,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
// Define player stats
$this->maniaControl->getStatisticManager()->defineStatMetaData(self::STAT_PLAYER_DONATIONS);
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5,self::DONATIONPLUGIN_MENU_ID,$this,'displayDonateWidget');
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::DONATIONPLUGIN_MENU_ID, $this, 'displayDonateWidget');
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED, true);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000");

View File

@ -736,7 +736,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
* Get all players votes
*
* @param Map $map
* @return array
* @return array|bool
*/
public function getMapPlayerVotes(Map $map) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
@ -893,7 +893,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
* Get the current Votes for the Map
*
* @param Map $map
* @return array
* @return array|bool
*/
public function getMapVotes(Map $map) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli();