mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
updater: populate missing return type information
This commit is contained in:
parent
db734675d8
commit
e8a5fa8a37
@ -63,6 +63,8 @@ class AutoUpdater{
|
||||
* Callback used at the end of the update checking task
|
||||
*
|
||||
* @param array $updateInfo
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkUpdateCallback(array $updateInfo){
|
||||
$this->updateInfo = $updateInfo;
|
||||
@ -92,6 +94,8 @@ class AutoUpdater{
|
||||
|
||||
/**
|
||||
* Posts a warning to the console to tell the user there is an update available
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function showConsoleUpdate(){
|
||||
$messages = [
|
||||
@ -109,12 +113,17 @@ class AutoUpdater{
|
||||
* Shows a warning to a player to tell them there is an update available
|
||||
*
|
||||
* @param Player $player
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function showPlayerUpdate(Player $player){
|
||||
$player->sendMessage(TextFormat::DARK_PURPLE . "The version of " . $this->server->getName() . " that this server is running is out of date. Please consider updating to the latest version.");
|
||||
$player->sendMessage(TextFormat::DARK_PURPLE . "Check the console for more details.");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function showChannelSuggestionStable(){
|
||||
$this->printConsoleMessage([
|
||||
"It appears you're running a Stable build, when you've specified that you prefer to run " . ucfirst($this->getChannel()) . " builds.",
|
||||
@ -122,6 +131,9 @@ class AutoUpdater{
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function showChannelSuggestionBeta(){
|
||||
$this->printConsoleMessage([
|
||||
"It appears you're running a Beta build, when you've specified that you prefer to run Stable builds.",
|
||||
@ -129,6 +141,9 @@ class AutoUpdater{
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function printConsoleMessage(array $lines, string $logLevel = \LogLevel::INFO){
|
||||
$logger = $this->server->getLogger();
|
||||
|
||||
@ -151,6 +166,8 @@ class AutoUpdater{
|
||||
|
||||
/**
|
||||
* Schedules an AsyncTask to check for an update.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function doCheck(){
|
||||
$this->server->getAsyncPool()->submitTask(new UpdateCheckTask($this->endpoint, $this->getChannel()));
|
||||
@ -158,6 +175,8 @@ class AutoUpdater{
|
||||
|
||||
/**
|
||||
* Checks the update information against the current server version to decide if there's an update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function checkUpdate(){
|
||||
if($this->updateInfo === null){
|
||||
|
Loading…
x
Reference in New Issue
Block a user