mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
Generate parameter name
This commit is contained in:
parent
799dfecdd9
commit
f4f31b654b
@ -35,6 +35,7 @@ use function fwrite;
|
|||||||
use function implode;
|
use function implode;
|
||||||
use function is_dir;
|
use function is_dir;
|
||||||
use function ksort;
|
use function ksort;
|
||||||
|
use function lcfirst;
|
||||||
use function mb_strtoupper;
|
use function mb_strtoupper;
|
||||||
use function preg_match;
|
use function preg_match;
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
@ -84,9 +85,10 @@ function generateMethodAnnotations(string $namespaceName, array $members, array
|
|||||||
foreach(Utils::stringifyKeys($overloadedMembers) as $baseName => $member){
|
foreach(Utils::stringifyKeys($overloadedMembers) as $baseName => $member){
|
||||||
$accessor = mb_strtoupper($baseName);
|
$accessor = mb_strtoupper($baseName);
|
||||||
$returnTypehint = makeTypehint($namespaceName, new \ReflectionClass($member->memberClass));
|
$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);
|
ksort($memberLines, SORT_STRING);
|
||||||
|
|
||||||
|
@ -79,10 +79,10 @@ use function strtolower;
|
|||||||
* @see build/generate-registry-annotations.php
|
* @see build/generate-registry-annotations.php
|
||||||
* @generate-registry-docblock
|
* @generate-registry-docblock
|
||||||
*
|
*
|
||||||
* @method static Sapling SAPLING(\pocketmine\block\utils\SaplingType)
|
* @method static Sapling SAPLING(\pocketmine\block\utils\SaplingType $saplingType)
|
||||||
* @method static Leaves LEAVES(\pocketmine\block\utils\LeavesType)
|
* @method static Leaves LEAVES(\pocketmine\block\utils\LeavesType $leavesType)
|
||||||
* @method static FloorSign SIGN(\pocketmine\block\utils\WoodType)
|
* @method static FloorSign SIGN(\pocketmine\block\utils\WoodType $woodType)
|
||||||
* @method static WallSign WALL_SIGN(\pocketmine\block\utils\WoodType)
|
* @method static WallSign WALL_SIGN(\pocketmine\block\utils\WoodType $woodType)
|
||||||
* @method static WoodenButton ACACIA_BUTTON()
|
* @method static WoodenButton ACACIA_BUTTON()
|
||||||
* @method static WoodenDoor ACACIA_DOOR()
|
* @method static WoodenDoor ACACIA_DOOR()
|
||||||
* @method static WoodenFence ACACIA_FENCE()
|
* @method static WoodenFence ACACIA_FENCE()
|
||||||
|
@ -48,8 +48,8 @@ use function strtolower;
|
|||||||
* @see build/generate-registry-annotations.php
|
* @see build/generate-registry-annotations.php
|
||||||
* @generate-registry-docblock
|
* @generate-registry-docblock
|
||||||
*
|
*
|
||||||
* @method static Boat BOAT(BoatType)
|
* @method static Boat BOAT(BoatType $boatType)
|
||||||
* @method static ItemBlockWallOrFloor SIGN(\pocketmine\block\utils\WoodType)
|
* @method static ItemBlockWallOrFloor SIGN(\pocketmine\block\utils\WoodType $woodType)
|
||||||
* @method static Boat ACACIA_BOAT()
|
* @method static Boat ACACIA_BOAT()
|
||||||
* @method static ItemBlockWallOrFloor ACACIA_SIGN()
|
* @method static ItemBlockWallOrFloor ACACIA_SIGN()
|
||||||
* @method static ItemBlock AIR()
|
* @method static ItemBlock AIR()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user