diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 8b7d9a841..9734cddb0 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -74,6 +74,7 @@ return (new PhpCsFixer\Config) 'return_type_declaration' => [ 'space_before' => 'one' ], + 'single_blank_line_at_eof' => true, 'single_import_per_statement' => true, 'strict_param' => true, 'unary_operator_spaces' => true, diff --git a/build/generate-registry-annotations.php b/build/generate-registry-annotations.php index 11e15a3c6..a5959eaf5 100644 --- a/build/generate-registry-annotations.php +++ b/build/generate-registry-annotations.php @@ -116,4 +116,3 @@ foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($argv[1], echo "No changes made to file $file\n"; } } - diff --git a/composer.json b/composer.json index 22410324f..829c660e9 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.3.1", + "phpstan/phpstan": "1.3.3", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 3b631974a..10266bafd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8b6fac2b9bbfe685d654ed417713d894", + "content-hash": "934b70469f9dcb4c9697f69e6c4a9ec5", "packages": [ { "name": "adhocore/json-comment", @@ -1900,16 +1900,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.3.1", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c3e7a5837829b3cd5907b895da73a4da084a9f8f" + "reference": "151a51f6149855785fbd883e79768c0abc96b75f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c3e7a5837829b3cd5907b895da73a4da084a9f8f", - "reference": "c3e7a5837829b3cd5907b895da73a4da084a9f8f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/151a51f6149855785fbd883e79768c0abc96b75f", + "reference": "151a51f6149855785fbd883e79768c0abc96b75f", "shasum": "" }, "require": { @@ -1940,7 +1940,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.3.1" + "source": "https://github.com/phpstan/phpstan/tree/1.3.3" }, "funding": [ { @@ -1960,7 +1960,7 @@ "type": "tidelift" } ], - "time": "2022-01-04T17:12:37+00:00" + "time": "2022-01-07T09:49:03+00:00" }, { "name": "phpstan/phpstan-phpunit", diff --git a/src/block/inventory/CraftingTableInventory.php b/src/block/inventory/CraftingTableInventory.php index a885df4be..3659a1f5d 100644 --- a/src/block/inventory/CraftingTableInventory.php +++ b/src/block/inventory/CraftingTableInventory.php @@ -34,4 +34,4 @@ final class CraftingTableInventory extends CraftingGrid implements BlockInventor $this->holder = $holder; parent::__construct(CraftingGrid::SIZE_BIG); } -} \ No newline at end of file +} diff --git a/src/crafting/FurnaceRecipeManager.php b/src/crafting/FurnaceRecipeManager.php index 9cb9c6eef..15bdee2fe 100644 --- a/src/crafting/FurnaceRecipeManager.php +++ b/src/crafting/FurnaceRecipeManager.php @@ -65,4 +65,4 @@ final class FurnaceRecipeManager{ public function match(Item $input) : ?FurnaceRecipe{ return $this->furnaceRecipes[$input->getId() . ":" . $input->getMeta()] ?? $this->furnaceRecipes[$input->getId() . ":?"] ?? null; } -} \ No newline at end of file +} diff --git a/src/crash/CrashDumpData.php b/src/crash/CrashDumpData.php index a3f13f2ca..295517b0a 100644 --- a/src/crash/CrashDumpData.php +++ b/src/crash/CrashDumpData.php @@ -81,4 +81,4 @@ final class CrashDumpData implements \JsonSerializable{ $result["server.properties"] = $this->serverDotProperties; return $result; } -} \ No newline at end of file +} diff --git a/src/crash/CrashDumpDataGeneral.php b/src/crash/CrashDumpDataGeneral.php index 33e41ce01..0f7188364 100644 --- a/src/crash/CrashDumpDataGeneral.php +++ b/src/crash/CrashDumpDataGeneral.php @@ -43,4 +43,4 @@ final class CrashDumpDataGeneral{ public string $os, public array $composer_libraries, ){} -} \ No newline at end of file +} diff --git a/src/crash/CrashDumpDataPluginEntry.php b/src/crash/CrashDumpDataPluginEntry.php index 21139f431..661c56ca2 100644 --- a/src/crash/CrashDumpDataPluginEntry.php +++ b/src/crash/CrashDumpDataPluginEntry.php @@ -42,4 +42,4 @@ final class CrashDumpDataPluginEntry{ public string $load, public string $website, ){} -} \ No newline at end of file +} diff --git a/src/crash/CrashDumpRenderer.php b/src/crash/CrashDumpRenderer.php index 68945229d..a9f09df9f 100644 --- a/src/crash/CrashDumpRenderer.php +++ b/src/crash/CrashDumpRenderer.php @@ -100,4 +100,4 @@ final class CrashDumpRenderer{ public function addLine(string $line = "") : void{ fwrite($this->fp, $line . PHP_EOL); } -} \ No newline at end of file +} diff --git a/src/data/SavedDataLoadingException.php b/src/data/SavedDataLoadingException.php index fcc72c7ab..03dfa392b 100644 --- a/src/data/SavedDataLoadingException.php +++ b/src/data/SavedDataLoadingException.php @@ -25,4 +25,4 @@ namespace pocketmine\data; final class SavedDataLoadingException extends \RuntimeException{ -} \ No newline at end of file +} diff --git a/src/data/bedrock/LegacyBiomeIdToStringIdMap.php b/src/data/bedrock/LegacyBiomeIdToStringIdMap.php index e377e371d..c967c5cee 100644 --- a/src/data/bedrock/LegacyBiomeIdToStringIdMap.php +++ b/src/data/bedrock/LegacyBiomeIdToStringIdMap.php @@ -32,4 +32,4 @@ final class LegacyBiomeIdToStringIdMap extends LegacyToStringBidirectionalIdMap{ public function __construct(){ parent::__construct(Path::join(\pocketmine\BEDROCK_DATA_PATH, 'biome_id_map.json')); } -} \ No newline at end of file +} diff --git a/src/entity/InvalidSkinException.php b/src/entity/InvalidSkinException.php index 65ad5cf17..43aef8f10 100644 --- a/src/entity/InvalidSkinException.php +++ b/src/entity/InvalidSkinException.php @@ -25,4 +25,4 @@ namespace pocketmine\entity; final class InvalidSkinException extends \InvalidArgumentException{ -} \ No newline at end of file +} diff --git a/src/entity/effect/StringToEffectParser.php b/src/entity/effect/StringToEffectParser.php index b35ff68fc..2eb8731b9 100644 --- a/src/entity/effect/StringToEffectParser.php +++ b/src/entity/effect/StringToEffectParser.php @@ -70,4 +70,4 @@ final class StringToEffectParser extends StringToTParser{ public function parse(string $input) : ?Effect{ return parent::parse($input); } -} \ No newline at end of file +} diff --git a/src/event/block/BlockItemPickupEvent.php b/src/event/block/BlockItemPickupEvent.php index 242840538..9b41b8730 100644 --- a/src/event/block/BlockItemPickupEvent.php +++ b/src/event/block/BlockItemPickupEvent.php @@ -57,4 +57,4 @@ class BlockItemPickupEvent extends BlockEvent implements Cancellable{ public function setInventory(?Inventory $inventory) : void{ $this->inventory = $inventory; } -} \ No newline at end of file +} diff --git a/src/event/block/StructureGrowEvent.php b/src/event/block/StructureGrowEvent.php index 30d7c7ceb..6dc462d7c 100644 --- a/src/event/block/StructureGrowEvent.php +++ b/src/event/block/StructureGrowEvent.php @@ -37,4 +37,4 @@ class StructureGrowEvent extends BlockEvent implements Cancellable{ public function getPlayer() : ?Player{ return $this->player; } -} \ No newline at end of file +} diff --git a/src/event/player/PlayerDisplayNameChangeEvent.php b/src/event/player/PlayerDisplayNameChangeEvent.php index 27de577c8..8956ca2c4 100644 --- a/src/event/player/PlayerDisplayNameChangeEvent.php +++ b/src/event/player/PlayerDisplayNameChangeEvent.php @@ -45,4 +45,4 @@ class PlayerDisplayNameChangeEvent extends PlayerEvent{ public function getNewName() : string{ return $this->newName; } -} \ No newline at end of file +} diff --git a/src/inventory/PlayerCraftingInventory.php b/src/inventory/PlayerCraftingInventory.php index d3a817434..0c02eb47b 100644 --- a/src/inventory/PlayerCraftingInventory.php +++ b/src/inventory/PlayerCraftingInventory.php @@ -33,4 +33,4 @@ final class PlayerCraftingInventory extends CraftingGrid implements TemporaryInv } public function getHolder() : Player{ return $this->holder; } -} \ No newline at end of file +} diff --git a/src/inventory/TemporaryInventory.php b/src/inventory/TemporaryInventory.php index 9e239dcdf..b2905dd8b 100644 --- a/src/inventory/TemporaryInventory.php +++ b/src/inventory/TemporaryInventory.php @@ -25,4 +25,4 @@ namespace pocketmine\inventory; interface TemporaryInventory extends Inventory{ -} \ No newline at end of file +} diff --git a/src/item/enchantment/StringToEnchantmentParser.php b/src/item/enchantment/StringToEnchantmentParser.php index 2205f12ff..104cc3686 100644 --- a/src/item/enchantment/StringToEnchantmentParser.php +++ b/src/item/enchantment/StringToEnchantmentParser.php @@ -63,4 +63,4 @@ final class StringToEnchantmentParser extends StringToTParser{ public function parse(string $input) : ?Enchantment{ return parent::parse($input); } -} \ No newline at end of file +} diff --git a/src/network/NetworkInterfaceStartException.php b/src/network/NetworkInterfaceStartException.php index 3dfd2b0a7..d3a563825 100644 --- a/src/network/NetworkInterfaceStartException.php +++ b/src/network/NetworkInterfaceStartException.php @@ -29,4 +29,4 @@ namespace pocketmine\network; */ final class NetworkInterfaceStartException extends \RuntimeException{ -} \ No newline at end of file +} diff --git a/src/network/mcpe/compression/Compressor.php b/src/network/mcpe/compression/Compressor.php index bbc8fac4f..50e8ab609 100644 --- a/src/network/mcpe/compression/Compressor.php +++ b/src/network/mcpe/compression/Compressor.php @@ -33,4 +33,4 @@ interface Compressor{ public function decompress(string $payload) : string; public function compress(string $payload) : string; -} \ No newline at end of file +} diff --git a/src/network/mcpe/compression/DecompressionException.php b/src/network/mcpe/compression/DecompressionException.php index dfaf7e50e..8cff0e6d2 100644 --- a/src/network/mcpe/compression/DecompressionException.php +++ b/src/network/mcpe/compression/DecompressionException.php @@ -25,4 +25,4 @@ namespace pocketmine\network\mcpe\compression; final class DecompressionException extends \RuntimeException{ -} \ No newline at end of file +} diff --git a/src/network/mcpe/raklib/RakLibThreadCrashInfo.php b/src/network/mcpe/raklib/RakLibThreadCrashInfo.php index 806aebc85..c58f28e3f 100644 --- a/src/network/mcpe/raklib/RakLibThreadCrashInfo.php +++ b/src/network/mcpe/raklib/RakLibThreadCrashInfo.php @@ -59,4 +59,4 @@ final class RakLibThreadCrashInfo{ public function makePrettyMessage() : string{ return sprintf("%s: \"%s\" in %s on line %d", $this->class ?? "Fatal error", $this->message, Filesystem::cleanPath($this->file), $this->line); } -} \ No newline at end of file +} diff --git a/src/plugin/PluginLoadTriageEntry.php b/src/plugin/PluginLoadTriageEntry.php index 5a1a875de..2c8643b1d 100644 --- a/src/plugin/PluginLoadTriageEntry.php +++ b/src/plugin/PluginLoadTriageEntry.php @@ -39,4 +39,4 @@ final class PluginLoadTriageEntry{ public function getLoader() : PluginLoader{ return $this->loader; } public function getDescription() : PluginDescription{ return $this->description; } -} \ No newline at end of file +} diff --git a/src/plugin/PluginLoadabilityChecker.php b/src/plugin/PluginLoadabilityChecker.php index 74696749e..4451cc6f1 100644 --- a/src/plugin/PluginLoadabilityChecker.php +++ b/src/plugin/PluginLoadabilityChecker.php @@ -110,4 +110,4 @@ final class PluginLoadabilityChecker{ return null; } -} \ No newline at end of file +} diff --git a/src/promise/Promise.php b/src/promise/Promise.php index 28666917e..5b036cdd3 100644 --- a/src/promise/Promise.php +++ b/src/promise/Promise.php @@ -52,4 +52,4 @@ final class Promise{ public function isResolved() : bool{ return $this->shared->resolved; } -} \ No newline at end of file +} diff --git a/src/promise/PromiseResolver.php b/src/promise/PromiseResolver.php index 0f447693f..aca3b6b89 100644 --- a/src/promise/PromiseResolver.php +++ b/src/promise/PromiseResolver.php @@ -72,4 +72,4 @@ final class PromiseResolver{ public function getPromise() : Promise{ return $this->promise; } -} \ No newline at end of file +} diff --git a/src/utils/SingletonTrait.php b/src/utils/SingletonTrait.php index 99e30e41c..ee63cbb9c 100644 --- a/src/utils/SingletonTrait.php +++ b/src/utils/SingletonTrait.php @@ -45,4 +45,4 @@ trait SingletonTrait{ public static function reset() : void{ self::$instance = null; } -} \ No newline at end of file +} diff --git a/src/utils/StringToTParser.php b/src/utils/StringToTParser.php index a15204ba4..5320f2b58 100644 --- a/src/utils/StringToTParser.php +++ b/src/utils/StringToTParser.php @@ -79,4 +79,4 @@ abstract class StringToTParser{ public function getKnownAliases() : array{ return array_keys($this->callbackMap); } -} \ No newline at end of file +} diff --git a/src/world/ChunkLockId.php b/src/world/ChunkLockId.php index 312b8c910..9931aa089 100644 --- a/src/world/ChunkLockId.php +++ b/src/world/ChunkLockId.php @@ -35,4 +35,4 @@ use pocketmine\utils\NotSerializable; final class ChunkLockId{ use NotCloneable; use NotSerializable; -} \ No newline at end of file +} diff --git a/src/world/generator/FlatGeneratorOptions.php b/src/world/generator/FlatGeneratorOptions.php index 01ca4a914..dee3ee78f 100644 --- a/src/world/generator/FlatGeneratorOptions.php +++ b/src/world/generator/FlatGeneratorOptions.php @@ -124,4 +124,4 @@ final class FlatGeneratorOptions{ return new self($structure, $biomeId, $options); } -} \ No newline at end of file +} diff --git a/src/world/generator/GeneratorManagerEntry.php b/src/world/generator/GeneratorManagerEntry.php index 2f7bbc16c..41611f384 100644 --- a/src/world/generator/GeneratorManagerEntry.php +++ b/src/world/generator/GeneratorManagerEntry.php @@ -45,4 +45,4 @@ final class GeneratorManagerEntry{ throw $exception; } } -} \ No newline at end of file +} diff --git a/tests/phpstan/rules/UnsafeForeachArrayOfStringRule.php b/tests/phpstan/rules/UnsafeForeachArrayOfStringRule.php index 639a5b469..952723278 100644 --- a/tests/phpstan/rules/UnsafeForeachArrayOfStringRule.php +++ b/tests/phpstan/rules/UnsafeForeachArrayOfStringRule.php @@ -87,4 +87,4 @@ final class UnsafeForeachArrayOfStringRule implements Rule{ return []; } -} \ No newline at end of file +} diff --git a/tests/phpunit/utils/fixtures/TestAbstractClass.php b/tests/phpunit/utils/fixtures/TestAbstractClass.php index 212806c4f..be3875240 100644 --- a/tests/phpunit/utils/fixtures/TestAbstractClass.php +++ b/tests/phpunit/utils/fixtures/TestAbstractClass.php @@ -6,4 +6,4 @@ namespace pocketmine\utils\fixtures; abstract class TestAbstractClass{ -} \ No newline at end of file +} diff --git a/tests/phpunit/utils/fixtures/TestInstantiableClass.php b/tests/phpunit/utils/fixtures/TestInstantiableClass.php index c3cb50c76..f0eb5f78f 100644 --- a/tests/phpunit/utils/fixtures/TestInstantiableClass.php +++ b/tests/phpunit/utils/fixtures/TestInstantiableClass.php @@ -6,4 +6,4 @@ namespace pocketmine\utils\fixtures; class TestInstantiableClass extends TestAbstractClass implements TestInterface{ -} \ No newline at end of file +} diff --git a/tests/phpunit/utils/fixtures/TestInterface.php b/tests/phpunit/utils/fixtures/TestInterface.php index bf4991f5b..0f3e8a15d 100644 --- a/tests/phpunit/utils/fixtures/TestInterface.php +++ b/tests/phpunit/utils/fixtures/TestInterface.php @@ -6,4 +6,4 @@ namespace pocketmine\utils\fixtures; interface TestInterface{ -} \ No newline at end of file +} diff --git a/tests/phpunit/utils/fixtures/TestSubclassOfInstantiableClass.php b/tests/phpunit/utils/fixtures/TestSubclassOfInstantiableClass.php index d9a5c111e..c77da4ab2 100644 --- a/tests/phpunit/utils/fixtures/TestSubclassOfInstantiableClass.php +++ b/tests/phpunit/utils/fixtures/TestSubclassOfInstantiableClass.php @@ -6,4 +6,4 @@ namespace pocketmine\utils\fixtures; class TestSubclassOfInstantiableClass extends TestInstantiableClass{ -} \ No newline at end of file +} diff --git a/tests/phpunit/utils/fixtures/TestTrait.php b/tests/phpunit/utils/fixtures/TestTrait.php index f7bbe8ac4..87b29ffd9 100644 --- a/tests/phpunit/utils/fixtures/TestTrait.php +++ b/tests/phpunit/utils/fixtures/TestTrait.php @@ -6,4 +6,4 @@ namespace pocketmine\utils\fixtures; trait TestTrait{ -} \ No newline at end of file +}