diff --git a/build/generate-registry-annotations.php b/build/generate-registry-annotations.php index fffd76a95b..6b8fb00059 100644 --- a/build/generate-registry-annotations.php +++ b/build/generate-registry-annotations.php @@ -35,6 +35,7 @@ use function fwrite; use function implode; use function is_dir; use function ksort; +use function lcfirst; use function mb_strtoupper; use function preg_match; use function sprintf; @@ -84,9 +85,10 @@ function generateMethodAnnotations(string $namespaceName, array $members, array foreach(Utils::stringifyKeys($overloadedMembers) as $baseName => $member){ $accessor = mb_strtoupper($baseName); $returnTypehint = makeTypehint($namespaceName, new \ReflectionClass($member->memberClass)); - $paramTypehint = makeTypehint($namespaceName, new \ReflectionClass($member->enumClass)); + $enumReflect = new \ReflectionClass($member->enumClass); + $paramTypehint = makeTypehint($namespaceName, $enumReflect); - $memberLines[] = sprintf(" * @method static %s %s(%s)", $returnTypehint, $accessor, $paramTypehint); + $memberLines[] = sprintf(" * @method static %s %s(%s \$%s)", $returnTypehint, $accessor, $paramTypehint, lcfirst($enumReflect->getShortName())); } ksort($memberLines, SORT_STRING); diff --git a/src/block/VanillaBlocks.php b/src/block/VanillaBlocks.php index 79d5c59999..b75b23358a 100644 --- a/src/block/VanillaBlocks.php +++ b/src/block/VanillaBlocks.php @@ -79,10 +79,10 @@ use function strtolower; * @see build/generate-registry-annotations.php * @generate-registry-docblock * - * @method static Sapling SAPLING(\pocketmine\block\utils\SaplingType) - * @method static Leaves LEAVES(\pocketmine\block\utils\LeavesType) - * @method static FloorSign SIGN(\pocketmine\block\utils\WoodType) - * @method static WallSign WALL_SIGN(\pocketmine\block\utils\WoodType) + * @method static Sapling SAPLING(\pocketmine\block\utils\SaplingType $saplingType) + * @method static Leaves LEAVES(\pocketmine\block\utils\LeavesType $leavesType) + * @method static FloorSign SIGN(\pocketmine\block\utils\WoodType $woodType) + * @method static WallSign WALL_SIGN(\pocketmine\block\utils\WoodType $woodType) * @method static WoodenButton ACACIA_BUTTON() * @method static WoodenDoor ACACIA_DOOR() * @method static WoodenFence ACACIA_FENCE() diff --git a/src/item/VanillaItems.php b/src/item/VanillaItems.php index 9863f63366..2e5d59db5b 100644 --- a/src/item/VanillaItems.php +++ b/src/item/VanillaItems.php @@ -48,8 +48,8 @@ use function strtolower; * @see build/generate-registry-annotations.php * @generate-registry-docblock * - * @method static Boat BOAT(BoatType) - * @method static ItemBlockWallOrFloor SIGN(\pocketmine\block\utils\WoodType) + * @method static Boat BOAT(BoatType $boatType) + * @method static ItemBlockWallOrFloor SIGN(\pocketmine\block\utils\WoodType $woodType) * @method static Boat ACACIA_BOAT() * @method static ItemBlockWallOrFloor ACACIA_SIGN() * @method static ItemBlock AIR()