From 1c7773c5f1d3d2e44da73f490133b38f5d43a9c4 Mon Sep 17 00:00:00 2001 From: Sandertv Date: Thu, 13 Apr 2017 14:58:53 +0200 Subject: [PATCH] Visibility keyword before final or abstract keyword. (#814) --- src/pocketmine/Player.php | 2 +- src/pocketmine/command/Command.php | 2 +- src/pocketmine/entity/Entity.php | 2 +- src/pocketmine/entity/Living.php | 2 +- src/pocketmine/item/Item.php | 4 ++-- src/pocketmine/level/generator/Generator.php | 14 ++++++------- .../level/generator/biome/Biome.php | 2 +- .../level/generator/populator/Populator.php | 2 +- src/pocketmine/metadata/MetadataStore.php | 2 +- src/pocketmine/metadata/MetadataValue.php | 4 ++-- src/pocketmine/nbt/tag/Tag.php | 2 +- src/pocketmine/plugin/PluginBase.php | 20 +++++++++---------- src/pocketmine/scheduler/AsyncTask.php | 2 +- src/pocketmine/scheduler/PluginTask.php | 2 +- src/pocketmine/scheduler/Task.php | 8 ++++---- src/pocketmine/tile/Spawnable.php | 2 +- src/pocketmine/tile/Tile.php | 2 +- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index b8c5ee62b..ac2a05e82 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3069,7 +3069,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade * @param string $reason Reason showed in console * @param bool $notify */ - public final function close($message = "", $reason = "generic reason", $notify = true){ + final public function close($message = "", $reason = "generic reason", $notify = true){ if($this->connected and !$this->closed){ if($notify and strlen((string) $reason) > 0){ diff --git a/src/pocketmine/command/Command.php b/src/pocketmine/command/Command.php index 07347c557..189a3b03b 100644 --- a/src/pocketmine/command/Command.php +++ b/src/pocketmine/command/Command.php @@ -132,7 +132,7 @@ abstract class Command{ * * @return mixed */ - public abstract function execute(CommandSender $sender, $commandLabel, array $args); + abstract public function execute(CommandSender $sender, $commandLabel, array $args); /** * @return string diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 9f31ee37d..4537c7d2b 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1092,7 +1092,7 @@ abstract class Entity extends Location implements Metadatable{ //return !($this instanceof Player); } - public final function scheduleUpdate(){ + final public function scheduleUpdate(){ $this->level->updateEntities[$this->id] = $this; } diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 26b0fcc5a..8cf9644af 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -86,7 +86,7 @@ abstract class Living extends Entity implements Damageable{ $this->namedtag->Health = new ShortTag("Health", $this->getHealth()); } - public abstract function getName(); + abstract public function getName(); public function hasLineOfSight(Entity $entity){ //TODO: head height diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 98e4a8207..7b49f0f6e 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -916,7 +916,7 @@ class Item implements ItemIds, \JsonSerializable{ * * @return bool */ - public final function equals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ + final public function equals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ if($this->id === $item->getId() and ($checkDamage === false or $this->getDamage() === $item->getDamage())){ if($checkCompound){ if($item->getCompoundTag() === $this->getCompoundTag()){ @@ -942,7 +942,7 @@ class Item implements ItemIds, \JsonSerializable{ * * @return bool */ - public final function deepEquals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ + final public function deepEquals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ return $this->equals($item, $checkDamage, $checkCompound); } diff --git a/src/pocketmine/level/generator/Generator.php b/src/pocketmine/level/generator/Generator.php index 401890484..c29c5d5cb 100644 --- a/src/pocketmine/level/generator/Generator.php +++ b/src/pocketmine/level/generator/Generator.php @@ -233,17 +233,17 @@ abstract class Generator{ return $noiseArray; } - public abstract function __construct(array $settings = []); + abstract public function __construct(array $settings = []); - public abstract function init(ChunkManager $level, Random $random); + abstract public function init(ChunkManager $level, Random $random); - public abstract function generateChunk($chunkX, $chunkZ); + abstract public function generateChunk($chunkX, $chunkZ); - public abstract function populateChunk($chunkX, $chunkZ); + abstract public function populateChunk($chunkX, $chunkZ); - public abstract function getSettings(); + abstract public function getSettings(); - public abstract function getName(); + abstract public function getName(); - public abstract function getSpawn(); + abstract public function getSpawn(); } diff --git a/src/pocketmine/level/generator/biome/Biome.php b/src/pocketmine/level/generator/biome/Biome.php index 17ee242e0..599de0334 100644 --- a/src/pocketmine/level/generator/biome/Biome.php +++ b/src/pocketmine/level/generator/biome/Biome.php @@ -137,7 +137,7 @@ abstract class Biome{ return $this->id; } - public abstract function getName(); + abstract public function getName(); public function getMinElevation(){ return $this->minElevation; diff --git a/src/pocketmine/level/generator/populator/Populator.php b/src/pocketmine/level/generator/populator/Populator.php index 7eab9fde8..e089a0098 100644 --- a/src/pocketmine/level/generator/populator/Populator.php +++ b/src/pocketmine/level/generator/populator/Populator.php @@ -28,5 +28,5 @@ use pocketmine\level\ChunkManager; use pocketmine\utils\Random; abstract class Populator{ - public abstract function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random); + abstract public function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random); } \ No newline at end of file diff --git a/src/pocketmine/metadata/MetadataStore.php b/src/pocketmine/metadata/MetadataStore.php index 586b648af..9cb66dacd 100644 --- a/src/pocketmine/metadata/MetadataStore.php +++ b/src/pocketmine/metadata/MetadataStore.php @@ -136,5 +136,5 @@ abstract class MetadataStore{ * * @throws \InvalidArgumentException */ - public abstract function disambiguate(Metadatable $subject, $metadataKey); + abstract public function disambiguate(Metadatable $subject, $metadataKey); } \ No newline at end of file diff --git a/src/pocketmine/metadata/MetadataValue.php b/src/pocketmine/metadata/MetadataValue.php index 4b927eaaf..4834003fc 100644 --- a/src/pocketmine/metadata/MetadataValue.php +++ b/src/pocketmine/metadata/MetadataValue.php @@ -43,11 +43,11 @@ abstract class MetadataValue{ * * @return mixed */ - public abstract function value(); + abstract public function value(); /** * Invalidates this metadata item, forcing it to recompute when next * accessed. */ - public abstract function invalidate(); + abstract public function invalidate(); } \ No newline at end of file diff --git a/src/pocketmine/nbt/tag/Tag.php b/src/pocketmine/nbt/tag/Tag.php index 9359a5b2f..fa2d395c5 100644 --- a/src/pocketmine/nbt/tag/Tag.php +++ b/src/pocketmine/nbt/tag/Tag.php @@ -34,7 +34,7 @@ abstract class Tag extends \stdClass{ return $this->value; } - public abstract function getType(); + abstract public function getType(); public function setValue($value){ $this->value = $value; diff --git a/src/pocketmine/plugin/PluginBase.php b/src/pocketmine/plugin/PluginBase.php index 1a21698a0..d998ea5bb 100644 --- a/src/pocketmine/plugin/PluginBase.php +++ b/src/pocketmine/plugin/PluginBase.php @@ -72,14 +72,14 @@ abstract class PluginBase implements Plugin{ /** * @return bool */ - public final function isEnabled(){ + final public function isEnabled(){ return $this->isEnabled === true; } /** * @param bool $boolean */ - public final function setEnabled($boolean = true){ + final public function setEnabled($boolean = true){ if($this->isEnabled !== $boolean){ $this->isEnabled = $boolean; if($this->isEnabled === true){ @@ -93,19 +93,19 @@ abstract class PluginBase implements Plugin{ /** * @return bool */ - public final function isDisabled(){ + final public function isDisabled(){ return $this->isEnabled === false; } - public final function getDataFolder(){ + final public function getDataFolder(){ return $this->dataFolder; } - public final function getDescription(){ + final public function getDescription(){ return $this->description; } - public final function init(PluginLoader $loader, Server $server, PluginDescription $description, $dataFolder, $file){ + final public function init(PluginLoader $loader, Server $server, PluginDescription $description, $dataFolder, $file){ if($this->initialized === false){ $this->initialized = true; $this->loader = $loader; @@ -128,7 +128,7 @@ abstract class PluginBase implements Plugin{ /** * @return bool */ - public final function isInitialized(){ + final public function isInitialized(){ return $this->initialized; } @@ -267,21 +267,21 @@ abstract class PluginBase implements Plugin{ /** * @return Server */ - public final function getServer(){ + final public function getServer(){ return $this->server; } /** * @return string */ - public final function getName(){ + final public function getName(){ return $this->description->getName(); } /** * @return string */ - public final function getFullName(){ + final public function getFullName(){ return $this->description->getFullName(); } diff --git a/src/pocketmine/scheduler/AsyncTask.php b/src/pocketmine/scheduler/AsyncTask.php index 455d2e1f4..68491511c 100644 --- a/src/pocketmine/scheduler/AsyncTask.php +++ b/src/pocketmine/scheduler/AsyncTask.php @@ -161,7 +161,7 @@ abstract class AsyncTask extends Collectable{ * * @return void */ - public abstract function onRun(); + abstract public function onRun(); /** * Actions to execute when completed (on main thread) diff --git a/src/pocketmine/scheduler/PluginTask.php b/src/pocketmine/scheduler/PluginTask.php index cacb732e3..645720dbf 100644 --- a/src/pocketmine/scheduler/PluginTask.php +++ b/src/pocketmine/scheduler/PluginTask.php @@ -41,7 +41,7 @@ abstract class PluginTask extends Task{ /** * @return Plugin */ - public final function getOwner(){ + final public function getOwner(){ return $this->owner; } diff --git a/src/pocketmine/scheduler/Task.php b/src/pocketmine/scheduler/Task.php index cbf82a74a..fc0681914 100644 --- a/src/pocketmine/scheduler/Task.php +++ b/src/pocketmine/scheduler/Task.php @@ -32,14 +32,14 @@ abstract class Task{ /** * @return TaskHandler */ - public final function getHandler(){ + final public function getHandler(){ return $this->taskHandler; } /** * @return int */ - public final function getTaskId(){ + final public function getTaskId(){ if($this->taskHandler !== null){ return $this->taskHandler->getTaskId(); } @@ -50,7 +50,7 @@ abstract class Task{ /** * @param TaskHandler $taskHandler */ - public final function setHandler($taskHandler){ + final public function setHandler($taskHandler){ if($this->taskHandler === null or $taskHandler === null){ $this->taskHandler = $taskHandler; } @@ -63,7 +63,7 @@ abstract class Task{ * * @return void */ - public abstract function onRun($currentTick); + abstract public function onRun($currentTick); /** * Actions to execute if the Task is cancelled diff --git a/src/pocketmine/tile/Spawnable.php b/src/pocketmine/tile/Spawnable.php index 07f0ffaa4..555cd75db 100644 --- a/src/pocketmine/tile/Spawnable.php +++ b/src/pocketmine/tile/Spawnable.php @@ -75,7 +75,7 @@ abstract class Spawnable extends Tile{ /** * @return CompoundTag */ - public abstract function getSpawnCompound(); + abstract public function getSpawnCompound(); /** * Called when a player updates a block entity's NBT data diff --git a/src/pocketmine/tile/Tile.php b/src/pocketmine/tile/Tile.php index 51c3ca9d8..daddd775a 100644 --- a/src/pocketmine/tile/Tile.php +++ b/src/pocketmine/tile/Tile.php @@ -159,7 +159,7 @@ abstract class Tile extends Position{ return false; } - public final function scheduleUpdate(){ + final public function scheduleUpdate(){ $this->level->updateTiles[$this->id] = $this; }