refactored phpdoc, return/break statements, uses
This commit is contained in:
@ -3,20 +3,15 @@
|
||||
namespace ManiaControl\Update;
|
||||
|
||||
use FML\Controls\Control;
|
||||
use FML\Controls\Entry;
|
||||
use FML\Controls\Frame;
|
||||
use FML\Controls\Label;
|
||||
use FML\Controls\Labels\Label_Button;
|
||||
use FML\Controls\Labels\Label_Text;
|
||||
use FML\Controls\Quads\Quad_Icons128x32_1;
|
||||
use FML\Controls\Quads\Quad_Icons128x128_1;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\Script\Script;
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Configurators\ConfiguratorMenu;
|
||||
use ManiaControl\Formatter;
|
||||
use ManiaControl\Files\FileUtil;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
||||
@ -65,8 +60,6 @@ class PluginInstallMenu implements CallbackListener, ConfiguratorMenu, Manialink
|
||||
$pagesId = 'PluginInstallPages';
|
||||
$frame = new Frame();
|
||||
|
||||
$pluginClasses = $this->maniaControl->pluginManager->getPluginClasses();
|
||||
|
||||
// Config
|
||||
$pagerSize = 9.;
|
||||
$entryHeight = 5.;
|
||||
@ -105,7 +98,7 @@ class PluginInstallMenu implements CallbackListener, ConfiguratorMenu, Manialink
|
||||
$pluginList = json_decode($dataJson);
|
||||
$index = 0;
|
||||
if ($pluginList && isset($pluginList[0])) {
|
||||
$pluginClasses = $this->maniaControl->pluginManager->getPluginClasses();
|
||||
$pluginClasses = $this->maniaControl->pluginManager->getPluginClasses();
|
||||
$pluginIds = array();
|
||||
/** @var Plugin $class */
|
||||
foreach($pluginClasses as $class) {
|
||||
|
@ -501,18 +501,18 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
if (!$bytes || $bytes <= 0) {
|
||||
trigger_error("Couldn't save plugin Zip.");
|
||||
if ($player) {
|
||||
$self->maniaControl->chat->sendError('Update failed: Couldn\'t save plugin zip!', $player->login);
|
||||
$self->maniaControl->chat->sendError("Update failed: Couldn't save plugin zip!", $player->login);
|
||||
}
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
$zip = new \ZipArchive();
|
||||
$result = $zip->open($updateFileName);
|
||||
if ($result !== true) {
|
||||
trigger_error("Couldn't open plugin Zip. ({$result})");
|
||||
if ($player) {
|
||||
$self->maniaControl->chat->sendError('Update failed: Couldn\'t open plugin zip!', $player->login);
|
||||
$self->maniaControl->chat->sendError("Update failed: Couldn't open plugin zip!", $player->login);
|
||||
}
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
$zip->extractTo(ManiaControlDir . '/plugins');
|
||||
@ -559,15 +559,15 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
$bytes = file_put_contents($installFileName, $installFileContent);
|
||||
if (!$bytes || $bytes <= 0) {
|
||||
trigger_error("Couldn't save plugin Zip.");
|
||||
$self->maniaControl->chat->sendError('Install failed: Couldn\'t save plugin zip!', $player->login);
|
||||
return false;
|
||||
$self->maniaControl->chat->sendError("Install failed: Couldn't save plugin zip!", $player->login);
|
||||
return;
|
||||
}
|
||||
$zip = new \ZipArchive();
|
||||
$result = $zip->open($installFileName);
|
||||
if ($result !== true) {
|
||||
trigger_error("Couldn't open plugin Zip. ({$result})");
|
||||
$self->maniaControl->chat->sendError('Install failed: Couldn\'t open plugin zip!', $player->login);
|
||||
return false;
|
||||
$self->maniaControl->chat->sendError("Install failed: Couldn't open plugin zip!", $player->login);
|
||||
return;
|
||||
}
|
||||
|
||||
$zip->extractTo(ManiaControlDir . '/plugins');
|
||||
@ -782,7 +782,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
if (!$bytes || $bytes <= 0) {
|
||||
trigger_error("Couldn't save Update Zip.");
|
||||
if ($player) {
|
||||
$self->maniaControl->chat->sendError('Update failed: Couldn\'t save Update zip!', $player->login);
|
||||
$self->maniaControl->chat->sendError("Update failed: Couldn't save Update zip!", $player->login);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -791,7 +791,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
||||
if ($result !== true) {
|
||||
trigger_error("Couldn't open Update Zip. ({$result})");
|
||||
if ($player) {
|
||||
$self->maniaControl->chat->sendError('Update failed: Couldn\'t open Update zip!', $player->login);
|
||||
$self->maniaControl->chat->sendError("Update failed: Couldn't open Update zip!", $player->login);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user