mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Improve type info for RegistryTrait::getAll() and its users
This commit is contained in:
parent
6dd5fec4ea
commit
88eafdd614
@ -585,6 +585,7 @@ final class VanillaBlocks{
|
||||
|
||||
/**
|
||||
* @return Block[]
|
||||
* @phpstan-return array<string, Block>
|
||||
*/
|
||||
public static function getAll() : array{
|
||||
//phpstan doesn't support generic traits yet :(
|
||||
|
@ -101,6 +101,7 @@ final class VanillaEffects{
|
||||
|
||||
/**
|
||||
* @return Effect[]
|
||||
* @phpstan-return array<string, Effect>
|
||||
*/
|
||||
public static function getAll() : array{
|
||||
//phpstan doesn't support generic traits yet :(
|
||||
|
@ -384,6 +384,7 @@ final class VanillaItems{
|
||||
|
||||
/**
|
||||
* @return Item[]
|
||||
* @phpstan-return array<string, Item>
|
||||
*/
|
||||
public static function getAll() : array{
|
||||
//phpstan doesn't support generic traits yet :(
|
||||
|
@ -48,6 +48,7 @@ trait EnumTrait{
|
||||
* This is overridden to change the return typehint.
|
||||
*
|
||||
* @return self[]
|
||||
* @phpstan-return array<string, self>
|
||||
*/
|
||||
public static function getAll() : array{
|
||||
//phpstan doesn't support generic traits yet :(
|
||||
|
@ -29,7 +29,10 @@ use function mb_strtoupper;
|
||||
use function preg_match;
|
||||
|
||||
trait RegistryTrait{
|
||||
/** @var object[] */
|
||||
/**
|
||||
* @var object[]
|
||||
* @phpstan-var array<string, object>
|
||||
*/
|
||||
private static $members = null;
|
||||
|
||||
private static function verifyName(string $name) : void{
|
||||
@ -107,6 +110,7 @@ trait RegistryTrait{
|
||||
|
||||
/**
|
||||
* @return object[]
|
||||
* @phpstan-return array<string, object>
|
||||
*/
|
||||
private static function _registryGetAll() : array{
|
||||
self::checkInit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user