From 99996b62d6c86758cb4942f274cde3bbbe3eb880 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 6 Dec 2022 13:21:20 +0000 Subject: [PATCH] Align PhpDoc @param tags according to PHP-CS-Fixer --- build/server-phar.php | 2 +- src/MemoryManager.php | 4 ++-- src/Server.php | 8 ++++---- src/ServerConfigGroup.php | 2 +- src/block/BaseBanner.php | 2 +- src/block/Block.php | 2 +- src/block/BlockFactory.php | 2 +- src/block/tile/Banner.php | 2 +- src/command/CommandExecutor.php | 2 +- src/crafting/CraftingManager.php | 2 +- src/crafting/ShapedRecipe.php | 16 ++++++++-------- src/crafting/ShapelessRecipe.php | 3 ++- src/entity/Entity.php | 2 +- src/entity/effect/Effect.php | 6 +++--- src/entity/effect/EffectInstance.php | 2 +- src/event/entity/EntityExplodeEvent.php | 2 +- src/event/inventory/CraftItemEvent.php | 4 ++-- src/form/Form.php | 2 +- src/item/Banner.php | 2 +- src/item/Item.php | 2 +- src/network/AdvancedNetworkInterface.php | 2 +- src/network/mcpe/PacketBroadcaster.php | 2 +- src/network/mcpe/convert/ItemTranslator.php | 2 +- src/player/Player.php | 18 +++++++++--------- src/plugin/PluginBase.php | 2 +- src/resourcepacks/ResourcePack.php | 2 +- src/resourcepacks/ResourcePackManager.php | 2 +- src/scheduler/AsyncTask.php | 4 ++-- src/scheduler/AsyncWorker.php | 2 +- src/scheduler/BulkCurlTaskOperation.php | 2 +- src/utils/Config.php | 6 +++--- src/utils/Git.php | 2 +- src/utils/Internet.php | 8 ++++---- src/utils/Process.php | 4 ++-- src/utils/Random.php | 2 +- src/utils/Utils.php | 2 +- src/world/World.php | 18 +++++++++--------- src/world/WorldManager.php | 2 +- src/world/format/Chunk.php | 4 ++-- src/world/format/io/leveldb/LevelDB.php | 2 +- src/world/generator/FlatGeneratorOptions.php | 2 +- src/world/generator/GeneratorManager.php | 8 ++++---- src/world/light/SkyLightUpdate.php | 4 ++-- .../mcpe/handler/StupidJsonDecodeTest.php | 2 +- 44 files changed, 87 insertions(+), 86 deletions(-) diff --git a/build/server-phar.php b/build/server-phar.php index f3d26a2c4..cc404b682 100644 --- a/build/server-phar.php +++ b/build/server-phar.php @@ -45,7 +45,7 @@ use const PHP_EOL; require dirname(__DIR__) . '/vendor/autoload.php'; /** - * @param string[] $strings + * @param string[] $strings * * @return string[] */ diff --git a/src/MemoryManager.php b/src/MemoryManager.php index 70e5d8a77..9eecd370e 100644 --- a/src/MemoryManager.php +++ b/src/MemoryManager.php @@ -286,7 +286,7 @@ class MemoryManager{ /** * Static memory dumper accessible from any thread. * - * @param mixed $startingObject + * @param mixed $startingObject */ public static function dumpMemory($startingObject, string $outputFolder, int $maxNesting, int $maxStringSize, \Logger $logger) : void{ $hardLimit = Utils::assumeNotFalse(ini_get('memory_limit'), "memory_limit INI directive should always exist"); @@ -480,7 +480,7 @@ class MemoryManager{ /** * @param mixed $from - * @param object[] $objects reference parameter + * @param object[] $objects reference parameter * @param int[] $refCounts reference parameter * * @phpstan-param array $objects diff --git a/src/Server.php b/src/Server.php index 147e5a00b..a29cb29fc 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1268,7 +1268,7 @@ class Server{ } /** - * @param CommandSender[]|null $recipients + * @param CommandSender[]|null $recipients */ public function broadcastMessage(Translatable|string $message, ?array $recipients = null) : int{ $recipients = $recipients ?? $this->getBroadcastChannelSubscribers(self::BROADCAST_CHANNEL_USERS); @@ -1321,9 +1321,9 @@ class Server{ } /** - * @param int $fadeIn Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. - * @param int $stay Duration in ticks to stay on screen for - * @param int $fadeOut Duration in ticks for fade-out. + * @param int $fadeIn Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. + * @param int $stay Duration in ticks to stay on screen for + * @param int $fadeOut Duration in ticks for fade-out. * @param Player[]|null $recipients */ public function broadcastTitle(string $title, string $subtitle = "", int $fadeIn = -1, int $stay = -1, int $fadeOut = -1, ?array $recipients = null) : int{ diff --git a/src/ServerConfigGroup.php b/src/ServerConfigGroup.php index 0a3b09c87..bf82f534a 100644 --- a/src/ServerConfigGroup.php +++ b/src/ServerConfigGroup.php @@ -44,7 +44,7 @@ final class ServerConfigGroup{ ){} /** - * @param mixed $defaultValue + * @param mixed $defaultValue * * @return mixed */ diff --git a/src/block/BaseBanner.php b/src/block/BaseBanner.php index 2eeb42d74..5b3f9acce 100644 --- a/src/block/BaseBanner.php +++ b/src/block/BaseBanner.php @@ -87,7 +87,7 @@ abstract class BaseBanner extends Transparent{ } /** - * @param BannerPatternLayer[] $patterns + * @param BannerPatternLayer[] $patterns * * @phpstan-param list $patterns * @return $this diff --git a/src/block/Block.php b/src/block/Block.php index 6f2f1b27e..2e6dcb4ef 100644 --- a/src/block/Block.php +++ b/src/block/Block.php @@ -62,7 +62,7 @@ class Block{ protected ?array $collisionBoxes = null; /** - * @param string $name English name of the block type (TODO: implement translations) + * @param string $name English name of the block type (TODO: implement translations) */ public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){ if(($idInfo->getVariant() & $this->getStateBitmask()) !== 0){ diff --git a/src/block/BlockFactory.php b/src/block/BlockFactory.php index 8aabeb9ca..ec97df002 100644 --- a/src/block/BlockFactory.php +++ b/src/block/BlockFactory.php @@ -968,7 +968,7 @@ class BlockFactory{ * NOTE: If you are registering a new block type, you will need to add it to the creative inventory yourself - it * will not automatically appear there. * - * @param bool $override Whether to override existing registrations + * @param bool $override Whether to override existing registrations * * @throws \RuntimeException if something attempted to override an already-registered block without specifying the * $override parameter. diff --git a/src/block/tile/Banner.php b/src/block/tile/Banner.php index 0af4b2e79..191d4c8a5 100644 --- a/src/block/tile/Banner.php +++ b/src/block/tile/Banner.php @@ -135,7 +135,7 @@ class Banner extends Spawnable{ } /** - * @param BannerPatternLayer[] $patterns + * @param BannerPatternLayer[] $patterns * * @phpstan-param list $patterns */ diff --git a/src/command/CommandExecutor.php b/src/command/CommandExecutor.php index 138c4f22a..1356b7581 100644 --- a/src/command/CommandExecutor.php +++ b/src/command/CommandExecutor.php @@ -26,7 +26,7 @@ namespace pocketmine\command; interface CommandExecutor{ /** - * @param string[] $args + * @param string[] $args */ public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool; diff --git a/src/crafting/CraftingManager.php b/src/crafting/CraftingManager.php index 9eddb17a0..0b37080fa 100644 --- a/src/crafting/CraftingManager.php +++ b/src/crafting/CraftingManager.php @@ -201,7 +201,7 @@ class CraftingManager{ } /** - * @param Item[] $outputs + * @param Item[] $outputs */ public function matchRecipe(CraftingGrid $grid, array $outputs) : ?CraftingRecipe{ //TODO: try to match special recipes before anything else (first they need to be implemented!) diff --git a/src/crafting/ShapedRecipe.php b/src/crafting/ShapedRecipe.php index aa15eb4c5..371fe9dae 100644 --- a/src/crafting/ShapedRecipe.php +++ b/src/crafting/ShapedRecipe.php @@ -46,15 +46,15 @@ class ShapedRecipe implements CraftingRecipe{ /** * Constructs a ShapedRecipe instance. * - * @param string[] $shape
- * Array of 1, 2, or 3 strings representing the rows of the recipe. - * This accepts an array of 1, 2 or 3 strings. Each string should be of the same length and must be at most 3 - * characters long. Each character represents a unique type of ingredient. Spaces are interpreted as air. + * @param string[] $shape
+ * Array of 1, 2, or 3 strings representing the rows of the recipe. + * This accepts an array of 1, 2 or 3 strings. Each string should be of the same length and must be at most 3 + * characters long. Each character represents a unique type of ingredient. Spaces are interpreted as air. * @param Item[] $ingredients
- * Char => Item map of items to be set into the shape. - * This accepts an array of Items, indexed by character. Every unique character (except space) in the shape - * array MUST have a corresponding item in this list. Space character is automatically treated as air. - * @param Item[] $results List of items that this recipe produces when crafted. + * Char => Item map of items to be set into the shape. + * This accepts an array of Items, indexed by character. Every unique character (except space) in the shape + * array MUST have a corresponding item in this list. Space character is automatically treated as air. + * @param Item[] $results List of items that this recipe produces when crafted. * * Note: Recipes **do not** need to be square. Do NOT add padding for empty rows/columns. */ diff --git a/src/crafting/ShapelessRecipe.php b/src/crafting/ShapelessRecipe.php index 2c399fe04..2b77e58b8 100644 --- a/src/crafting/ShapelessRecipe.php +++ b/src/crafting/ShapelessRecipe.php @@ -36,7 +36,8 @@ class ShapelessRecipe implements CraftingRecipe{ /** * @param Item[] $ingredients No more than 9 total. This applies to sum of item stack counts, not count of array. - * @param Item[] $results List of result items created by this recipe. + * @param Item[] $results List of result items created by this recipe. + * * TODO: we'll want to make the type parameter mandatory in PM5 */ public function __construct(array $ingredients, array $results, ?ShapelessRecipeType $type = null){ diff --git a/src/entity/Entity.php b/src/entity/Entity.php index eb42813ec..e58910997 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1598,7 +1598,7 @@ abstract class Entity{ /** * @param Player[]|null $targets - * @param MetadataProperty[] $data Properly formatted entity data, defaults to everything + * @param MetadataProperty[] $data Properly formatted entity data, defaults to everything * * @phpstan-param array $data */ diff --git a/src/entity/effect/Effect.php b/src/entity/effect/Effect.php index cce009733..6373a2281 100644 --- a/src/entity/effect/Effect.php +++ b/src/entity/effect/Effect.php @@ -35,9 +35,9 @@ class Effect{ use NotSerializable; /** - * @param Translatable|string $name Translation key used for effect name - * @param Color $color Color of bubbles given by this effect - * @param bool $bad Whether the effect is harmful + * @param Translatable|string $name Translation key used for effect name + * @param Color $color Color of bubbles given by this effect + * @param bool $bad Whether the effect is harmful * @param bool $hasBubbles Whether the effect has potion bubbles. Some do not (e.g. Instant Damage has its own particles instead of bubbles) */ public function __construct( diff --git a/src/entity/effect/EffectInstance.php b/src/entity/effect/EffectInstance.php index f948b1f39..50d92a67b 100644 --- a/src/entity/effect/EffectInstance.php +++ b/src/entity/effect/EffectInstance.php @@ -36,7 +36,7 @@ class EffectInstance{ private Color $color; /** - * @param int|null $duration Passing null will use the effect type's default duration + * @param int|null $duration Passing null will use the effect type's default duration */ public function __construct(Effect $effectType, ?int $duration = null, int $amplifier = 0, bool $visible = true, bool $ambient = false, ?Color $overrideColor = null){ $this->effectType = $effectType; diff --git a/src/event/entity/EntityExplodeEvent.php b/src/event/entity/EntityExplodeEvent.php index 3a5e98203..e37742cb6 100644 --- a/src/event/entity/EntityExplodeEvent.php +++ b/src/event/entity/EntityExplodeEvent.php @@ -52,7 +52,7 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{ /** * @param Block[] $blocks - * @param float $yield 0-100 + * @param float $yield 0-100 */ public function __construct(Entity $entity, Position $position, array $blocks, float $yield){ $this->entity = $entity; diff --git a/src/event/inventory/CraftItemEvent.php b/src/event/inventory/CraftItemEvent.php index 2ca324d77..64f285f15 100644 --- a/src/event/inventory/CraftItemEvent.php +++ b/src/event/inventory/CraftItemEvent.php @@ -35,8 +35,8 @@ class CraftItemEvent extends Event implements Cancellable{ use CancellableTrait; /** - * @param Item[] $inputs - * @param Item[] $outputs + * @param Item[] $inputs + * @param Item[] $outputs */ public function __construct( private CraftingTransaction $transaction, diff --git a/src/form/Form.php b/src/form/Form.php index f17da3e36..97f49df07 100644 --- a/src/form/Form.php +++ b/src/form/Form.php @@ -34,7 +34,7 @@ interface Form extends \JsonSerializable{ /** * Handles a form response from a player. * - * @param mixed $data + * @param mixed $data * * @throws FormValidationException if the data could not be processed */ diff --git a/src/item/Banner.php b/src/item/Banner.php index 343fe8e24..92bf7729d 100644 --- a/src/item/Banner.php +++ b/src/item/Banner.php @@ -75,7 +75,7 @@ class Banner extends ItemBlockWallOrFloor{ } /** - * @param BannerPatternLayer[] $patterns + * @param BannerPatternLayer[] $patterns * * @phpstan-param list $patterns * diff --git a/src/item/Item.php b/src/item/Item.php index 2a4312539..93f1e1817 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -564,7 +564,7 @@ class Item implements \JsonSerializable{ /** * Compares an Item to this Item and check if they match. * - * @param bool $checkDamage Whether to verify that the damage values match. + * @param bool $checkDamage Whether to verify that the damage values match. * @param bool $checkCompound Whether to verify that the items' NBT match. */ final public function equals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ diff --git a/src/network/AdvancedNetworkInterface.php b/src/network/AdvancedNetworkInterface.php index 1fac1311d..da1af4b28 100644 --- a/src/network/AdvancedNetworkInterface.php +++ b/src/network/AdvancedNetworkInterface.php @@ -35,7 +35,7 @@ interface AdvancedNetworkInterface extends NetworkInterface{ /** * Prevents packets received from the IP address getting processed for the given timeout. * - * @param int $timeout Seconds + * @param int $timeout Seconds */ public function blockAddress(string $address, int $timeout = 300) : void; diff --git a/src/network/mcpe/PacketBroadcaster.php b/src/network/mcpe/PacketBroadcaster.php index a31393981..2a231b7f3 100644 --- a/src/network/mcpe/PacketBroadcaster.php +++ b/src/network/mcpe/PacketBroadcaster.php @@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\ClientboundPacket; interface PacketBroadcaster{ /** - * @param NetworkSession[] $recipients + * @param NetworkSession[] $recipients * @param ClientboundPacket[] $packets */ public function broadcastPackets(array $recipients, array $packets) : void; diff --git a/src/network/mcpe/convert/ItemTranslator.php b/src/network/mcpe/convert/ItemTranslator.php index f58e0bc22..ba13fa784 100644 --- a/src/network/mcpe/convert/ItemTranslator.php +++ b/src/network/mcpe/convert/ItemTranslator.php @@ -118,7 +118,7 @@ final class ItemTranslator{ } /** - * @param int[] $simpleMappings + * @param int[] $simpleMappings * @param int[][] $complexMappings * @phpstan-param array $simpleMappings * @phpstan-param array> $complexMappings diff --git a/src/player/Player.php b/src/player/Player.php index 0eb4fe5a5..4ba1c81ae 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -1390,7 +1390,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ /** * Returns whether the player can interact with the specified position. This checks distance and direction. * - * @param float $maxDiff defaults to half of the 3D diagonal width of a block + * @param float $maxDiff defaults to half of the 3D diagonal width of a block */ public function canInteract(Vector3 $pos, float $maxDistance, float $maxDiff = M_SQRT3 / 2) : bool{ $eyePos = $this->getEyePos(); @@ -1916,9 +1916,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ /** * Adds a title text to the user's screen, with an optional subtitle. * - * @param int $fadeIn Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. - * @param int $stay Duration in ticks to stay on screen for - * @param int $fadeOut Duration in ticks for fade-out. + * @param int $fadeIn Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. + * @param int $stay Duration in ticks to stay on screen for + * @param int $fadeOut Duration in ticks for fade-out. */ public function sendTitle(string $title, string $subtitle = "", int $fadeIn = -1, int $stay = -1, int $fadeOut = -1) : void{ $this->setTitleDuration($fadeIn, $stay, $fadeOut); @@ -1959,8 +1959,8 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ /** * Sets the title duration. * - * @param int $fadeIn Title fade-in time in ticks. - * @param int $stay Title stay time in ticks. + * @param int $fadeIn Title fade-in time in ticks. + * @param int $stay Title stay time in ticks. * @param int $fadeOut Title fade-out time in ticks. */ public function setTitleDuration(int $fadeIn, int $stay, int $fadeOut) : void{ @@ -2061,7 +2061,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ * Transfers a player to another server. * * @param string $address The IP address or hostname of the destination server - * @param int $port The destination port, defaults to 19132 + * @param int $port The destination port, defaults to 19132 * @param string $message Message to show in the console when closing the player * * @return bool if transfer was successful. @@ -2105,7 +2105,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ * * Note for internals developers: Do not call this from network sessions. It will cause a feedback loop. * - * @param string $reason Shown to the player, usually this will appear on their disconnect screen. + * @param string $reason Shown to the player, usually this will appear on their disconnect screen. * @param Translatable|string|null $quitMessage Message to broadcast to online players (null will use default) */ public function disconnect(string $reason, Translatable|string|null $quitMessage = null) : void{ @@ -2121,7 +2121,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ * @internal * This method executes post-disconnect actions and cleanups. * - * @param string $reason Shown to the player, usually this will appear on their disconnect screen. + * @param string $reason Shown to the player, usually this will appear on their disconnect screen. * @param Translatable|string|null $quitMessage Message to broadcast to online players (null will use default) */ public function onPostDisconnect(string $reason, Translatable|string|null $quitMessage) : void{ diff --git a/src/plugin/PluginBase.php b/src/plugin/PluginBase.php index 9b0ac2399..175ac0741 100644 --- a/src/plugin/PluginBase.php +++ b/src/plugin/PluginBase.php @@ -201,7 +201,7 @@ abstract class PluginBase implements Plugin, CommandExecutor{ } /** - * @param string[] $args + * @param string[] $args */ public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{ return false; diff --git a/src/resourcepacks/ResourcePack.php b/src/resourcepacks/ResourcePack.php index 93f446965..04feeeb3d 100644 --- a/src/resourcepacks/ResourcePack.php +++ b/src/resourcepacks/ResourcePack.php @@ -57,7 +57,7 @@ interface ResourcePack{ * Note that resource packs must **always** be in zip archive format for sending. * A folder resource loader may need to perform on-the-fly compression for this purpose. * - * @param int $start Offset to start reading the chunk from + * @param int $start Offset to start reading the chunk from * @param int $length Maximum length of data to return. * * @return string byte-array diff --git a/src/resourcepacks/ResourcePackManager.php b/src/resourcepacks/ResourcePackManager.php index d1482d8b6..c8b2cb389 100644 --- a/src/resourcepacks/ResourcePackManager.php +++ b/src/resourcepacks/ResourcePackManager.php @@ -58,7 +58,7 @@ class ResourcePackManager{ private array $encryptionKeys = []; /** - * @param string $path Path to resource-packs directory. + * @param string $path Path to resource-packs directory. */ public function __construct(string $path, \Logger $logger){ $this->path = $path; diff --git a/src/scheduler/AsyncTask.php b/src/scheduler/AsyncTask.php index c65552bf3..831753f4d 100644 --- a/src/scheduler/AsyncTask.php +++ b/src/scheduler/AsyncTask.php @@ -187,7 +187,7 @@ abstract class AsyncTask extends \Threaded{ * {@link AsyncTask::onCompletion} is called. * * @param mixed $progress The parameter passed to {@link AsyncTask#publishProgress}. It is serialize()'ed - * and then unserialize()'ed, as if it has been cloned. + * and then unserialize()'ed, as if it has been cloned. */ public function onProgressUpdate($progress) : void{ @@ -215,7 +215,7 @@ abstract class AsyncTask extends \Threaded{ * Objects stored in this storage can be retrieved using fetchLocal() on the same thread that this method was called * from. * - * @param mixed $complexData the data to store + * @param mixed $complexData the data to store */ protected function storeLocal(string $key, $complexData) : void{ if(self::$threadLocalStorage === null){ diff --git a/src/scheduler/AsyncWorker.php b/src/scheduler/AsyncWorker.php index af1ec2ad6..7262f9597 100644 --- a/src/scheduler/AsyncWorker.php +++ b/src/scheduler/AsyncWorker.php @@ -77,7 +77,7 @@ class AsyncWorker extends Worker{ * Saves mixed data into the worker's thread-local object store. This can be used to store objects which you * want to use on this worker thread from multiple AsyncTasks. * - * @param mixed $value + * @param mixed $value */ public function saveToThreadStore(string $identifier, $value) : void{ if(\Thread::getCurrentThread() !== $this){ diff --git a/src/scheduler/BulkCurlTaskOperation.php b/src/scheduler/BulkCurlTaskOperation.php index cd6b478fd..3291d8718 100644 --- a/src/scheduler/BulkCurlTaskOperation.php +++ b/src/scheduler/BulkCurlTaskOperation.php @@ -26,7 +26,7 @@ namespace pocketmine\scheduler; final class BulkCurlTaskOperation{ /** * @param string[] $extraHeaders - * @param mixed[] $extraOpts + * @param mixed[] $extraOpts * @phpstan-param list $extraHeaders * @phpstan-param array $extraOpts */ diff --git a/src/utils/Config.php b/src/utils/Config.php index 1e6c187dd..4bfed71b5 100644 --- a/src/utils/Config.php +++ b/src/utils/Config.php @@ -108,8 +108,8 @@ class Config{ ]; /** - * @param string $file Path of the file to be loaded - * @param int $type Config type to load, -1 by default (detect) + * @param string $file Path of the file to be loaded + * @param int $type Config type to load, -1 by default (detect) * @param mixed[] $default Array with the default values that will be written to the file if it did not exist * @phpstan-param array $default */ @@ -493,7 +493,7 @@ class Config{ /** * @param mixed[] $default - * @param mixed[] $data reference parameter + * @param mixed[] $data reference parameter * @phpstan-param array $default * @phpstan-param array $data * @phpstan-param-out array $data diff --git a/src/utils/Git.php b/src/utils/Git.php index 9d5744f06..041d795a1 100644 --- a/src/utils/Git.php +++ b/src/utils/Git.php @@ -36,7 +36,7 @@ final class Git{ /** * Returns the git hash of the currently checked out head of the given repository, or null on failure. * - * @param bool $dirty reference parameter, set to whether the repo has local changes + * @param bool $dirty reference parameter, set to whether the repo has local changes */ public static function getRepositoryState(string $dir, bool &$dirty) : ?string{ if(Process::execute("git -C \"$dir\" rev-parse HEAD", $out) === 0 && $out !== false && strlen($out = trim($out)) === 40){ diff --git a/src/utils/Internet.php b/src/utils/Internet.php index 3c22e460f..4aa39cb36 100644 --- a/src/utils/Internet.php +++ b/src/utils/Internet.php @@ -141,9 +141,9 @@ class Internet{ * * @phpstan-template TErrorVar of mixed * - * @param int $timeout default 10 + * @param int $timeout default 10 * @param string[] $extraHeaders - * @param string|null $err reference parameter, will be set to the output of curl_error(). Use this to retrieve errors that occured during the operation. + * @param string|null $err reference parameter, will be set to the output of curl_error(). Use this to retrieve errors that occured during the operation. * @phpstan-param list $extraHeaders * @phpstan-param TErrorVar $err * @phpstan-param-out TErrorVar|string $err @@ -165,7 +165,7 @@ class Internet{ * * @param string[]|string $args * @param string[] $extraHeaders - * @param string|null $err reference parameter, will be set to the output of curl_error(). Use this to retrieve errors that occurred during the operation. + * @param string|null $err reference parameter, will be set to the output of curl_error(). Use this to retrieve errors that occurred during the operation. * @phpstan-param string|array $args * @phpstan-param list $extraHeaders * @phpstan-param TErrorVar $err @@ -187,7 +187,7 @@ class Internet{ * General cURL shorthand function. * NOTE: This is a blocking operation and can take a significant amount of time. It is inadvisable to use this method on the main thread. * - * @param float|int $timeout The maximum connect timeout and timeout in seconds, correct to ms. + * @param float|int $timeout The maximum connect timeout and timeout in seconds, correct to ms. * @param string[] $extraHeaders extra headers to send as a plain string array * @param array $extraOpts extra CURLOPT_* to set as an [opt => value] map * @param \Closure|null $onSuccess function to be called if there is no error. Accepts a resource argument as the cURL handle. diff --git a/src/utils/Process.php b/src/utils/Process.php index bdc264133..47e6239df 100644 --- a/src/utils/Process.php +++ b/src/utils/Process.php @@ -150,8 +150,8 @@ final class Process{ /** * @param string $command Command to execute - * @param string|null $stdout Reference parameter to write stdout to - * @param string|null $stderr Reference parameter to write stderr to + * @param string|null $stdout Reference parameter to write stdout to + * @param string|null $stderr Reference parameter to write stderr to * @phpstan-param-out string $stdout * @phpstan-param-out string $stderr * diff --git a/src/utils/Random.php b/src/utils/Random.php index 3d2963c30..e0318c50a 100644 --- a/src/utils/Random.php +++ b/src/utils/Random.php @@ -115,7 +115,7 @@ class Random{ * Returns a random integer between $start and $end * * @param int $start default 0 - * @param int $end default 0x7fffffff + * @param int $end default 0x7fffffff */ public function nextRange(int $start = 0, int $end = 0x7fffffff) : int{ return $start + ($this->nextInt() % ($end + 1 - $start)); diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 3e8e420b7..a77a874d9 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -539,7 +539,7 @@ final class Utils{ * incompatible. * * @param callable|CallbackType $signature Dummy callable with the required parameters and return type - * @param callable $subject Callable to check the signature of + * @param callable $subject Callable to check the signature of * @phpstan-param anyCallable|CallbackType $signature * @phpstan-param anyCallable $subject * diff --git a/src/world/World.php b/src/world/World.php index b41ba3bb4..4c8d6a44c 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -643,7 +643,7 @@ class World implements ChunkManager{ * Returns a list of players who are in the given filter and also using the chunk containing the target position. * Used for broadcasting sounds and particles with specific targets. * - * @param Player[] $allowed + * @param Player[] $allowed * @phpstan-param list $allowed * * @return array @@ -1634,8 +1634,8 @@ class World implements ChunkManager{ * Note: If you're using this for performance-sensitive code, and you're guaranteed to be supplying ints in the * specified vector, consider using {@link getBlockAt} instead for better performance. * - * @param bool $cached Whether to use the block cache for getting the block (faster, but may be inaccurate) - * @param bool $addToCache Whether to cache the block object created by this method call. + * @param bool $cached Whether to use the block cache for getting the block (faster, but may be inaccurate) + * @param bool $addToCache Whether to cache the block object created by this method call. */ public function getBlock(Vector3 $pos, bool $cached = true, bool $addToCache = true) : Block{ return $this->getBlockAt((int) floor($pos->x), (int) floor($pos->y), (int) floor($pos->z), $cached, $addToCache); @@ -1647,7 +1647,7 @@ class World implements ChunkManager{ * Note for plugin developers: If you are using this method a lot (thousands of times for many positions for * example), you may want to set addToCache to false to avoid using excessive amounts of memory. * - * @param bool $cached Whether to use the block cache for getting the block (faster, but may be inaccurate) + * @param bool $cached Whether to use the block cache for getting the block (faster, but may be inaccurate) * @param bool $addToCache Whether to cache the block object created by this method call. */ public function getBlockAt(int $x, int $y, int $z, bool $cached = true, bool $addToCache = true) : Block{ @@ -1794,7 +1794,7 @@ class World implements ChunkManager{ * Tries to break a block using a item, including Player time checks if available * It'll try to lower the durability if Item is a tool, and set it to Air if broken. * - * @param Item $item reference parameter (if null, can break anything) + * @param Item $item reference parameter (if null, can break anything) * @phpstan-param-out Item $item */ public function useBreakOn(Vector3 $vector, Item &$item = null, ?Player $player = null, bool $createParticles = false) : bool{ @@ -1896,8 +1896,8 @@ class World implements ChunkManager{ /** * Uses a item on a position and face, placing it or activating the block * - * @param Player|null $player default null - * @param bool $playSound Whether to play a block-place sound if the block was placed successfully. + * @param Player|null $player default null + * @param bool $playSound Whether to play a block-place sound if the block was placed successfully. */ public function useItemOn(Vector3 $vector, Item &$item, int $face, ?Vector3 $clickVector = null, ?Player $player = null, bool $playSound = false) : bool{ $blockClicked = $this->getBlock($vector); @@ -2092,8 +2092,8 @@ class World implements ChunkManager{ /** * Returns the closest Entity to the specified position, within the given radius. * - * @param string $entityType Class of entity to use for instanceof - * @param bool $includeDead Whether to include entitites which are dead + * @param string $entityType Class of entity to use for instanceof + * @param bool $includeDead Whether to include entitites which are dead * @phpstan-template TEntity of Entity * @phpstan-param class-string $entityType * diff --git a/src/world/WorldManager.php b/src/world/WorldManager.php index 1c26d494b..80561298d 100644 --- a/src/world/WorldManager.php +++ b/src/world/WorldManager.php @@ -166,7 +166,7 @@ class WorldManager{ /** * Loads a world from the data directory * - * @param bool $autoUpgrade Converts worlds to the default format if the world's format is not writable / deprecated + * @param bool $autoUpgrade Converts worlds to the default format if the world's format is not writable / deprecated * * @throws WorldException */ diff --git a/src/world/format/Chunk.php b/src/world/format/Chunk.php index 865cc9a51..afcbf259e 100644 --- a/src/world/format/Chunk.php +++ b/src/world/format/Chunk.php @@ -164,8 +164,8 @@ class Chunk{ /** * Sets the biome ID at the specified X/Z chunk block coordinates * - * @param int $x 0-15 - * @param int $z 0-15 + * @param int $x 0-15 + * @param int $z 0-15 * @param int $biomeId 0-255 */ public function setBiomeId(int $x, int $z, int $biomeId) : void{ diff --git a/src/world/format/io/leveldb/LevelDB.php b/src/world/format/io/leveldb/LevelDB.php index f1f8d6daf..05f4dd8f1 100644 --- a/src/world/format/io/leveldb/LevelDB.php +++ b/src/world/format/io/leveldb/LevelDB.php @@ -504,7 +504,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ } /** - * @param CompoundTag[] $targets + * @param CompoundTag[] $targets */ private function writeTags(array $targets, string $index, \LevelDBWriteBatch $write) : void{ if(count($targets) > 0){ diff --git a/src/world/generator/FlatGeneratorOptions.php b/src/world/generator/FlatGeneratorOptions.php index b5b39a4b7..a47c97990 100644 --- a/src/world/generator/FlatGeneratorOptions.php +++ b/src/world/generator/FlatGeneratorOptions.php @@ -38,7 +38,7 @@ use function preg_match_all; final class FlatGeneratorOptions{ /** - * @param int[] $structure + * @param int[] $structure * @param mixed[] $extraOptions * @phpstan-param array $structure * @phpstan-param array|true> $extraOptions diff --git a/src/world/generator/GeneratorManager.php b/src/world/generator/GeneratorManager.php index e94d2336a..a00edd559 100644 --- a/src/world/generator/GeneratorManager.php +++ b/src/world/generator/GeneratorManager.php @@ -58,10 +58,10 @@ final class GeneratorManager{ } /** - * @param string $class Fully qualified name of class that extends \pocketmine\world\generator\Generator - * @param string $name Alias for this generator type that can be written in configs - * @param \Closure $presetValidator Callback to validate generator options for new worlds - * @param bool $overwrite Whether to force overwriting any existing registered generator with the same name + * @param string $class Fully qualified name of class that extends \pocketmine\world\generator\Generator + * @param string $name Alias for this generator type that can be written in configs + * @param \Closure $presetValidator Callback to validate generator options for new worlds + * @param bool $overwrite Whether to force overwriting any existing registered generator with the same name * * @phpstan-param \Closure(string) : ?InvalidGeneratorOptionsException $presetValidator * diff --git a/src/world/light/SkyLightUpdate.php b/src/world/light/SkyLightUpdate.php index d3416832c..bc0e1603c 100644 --- a/src/world/light/SkyLightUpdate.php +++ b/src/world/light/SkyLightUpdate.php @@ -208,8 +208,8 @@ class SkyLightUpdate extends LightUpdate{ /** * Recalculates the heightmap for the block column at the specified X/Z chunk coordinates * - * @param int $x 0-15 - * @param int $z 0-15 + * @param int $x 0-15 + * @param int $z 0-15 * @param \SplFixedArray|bool[] $directSkyLightBlockers * @phpstan-param \SplFixedArray $directSkyLightBlockers * diff --git a/tests/phpunit/network/mcpe/handler/StupidJsonDecodeTest.php b/tests/phpunit/network/mcpe/handler/StupidJsonDecodeTest.php index 99890b402..6a48bd1ba 100644 --- a/tests/phpunit/network/mcpe/handler/StupidJsonDecodeTest.php +++ b/tests/phpunit/network/mcpe/handler/StupidJsonDecodeTest.php @@ -57,7 +57,7 @@ class StupidJsonDecodeTest extends TestCase{ /** * @dataProvider stupidJsonDecodeProvider * - * @param mixed $expect + * @param mixed $expect * * @throws \ReflectionException */