mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 11:26:37 +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[]
|
* @return Block[]
|
||||||
|
* @phpstan-return array<string, Block>
|
||||||
*/
|
*/
|
||||||
public static function getAll() : array{
|
public static function getAll() : array{
|
||||||
//phpstan doesn't support generic traits yet :(
|
//phpstan doesn't support generic traits yet :(
|
||||||
|
@ -101,6 +101,7 @@ final class VanillaEffects{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Effect[]
|
* @return Effect[]
|
||||||
|
* @phpstan-return array<string, Effect>
|
||||||
*/
|
*/
|
||||||
public static function getAll() : array{
|
public static function getAll() : array{
|
||||||
//phpstan doesn't support generic traits yet :(
|
//phpstan doesn't support generic traits yet :(
|
||||||
|
@ -384,6 +384,7 @@ final class VanillaItems{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Item[]
|
* @return Item[]
|
||||||
|
* @phpstan-return array<string, Item>
|
||||||
*/
|
*/
|
||||||
public static function getAll() : array{
|
public static function getAll() : array{
|
||||||
//phpstan doesn't support generic traits yet :(
|
//phpstan doesn't support generic traits yet :(
|
||||||
|
@ -48,6 +48,7 @@ trait EnumTrait{
|
|||||||
* This is overridden to change the return typehint.
|
* This is overridden to change the return typehint.
|
||||||
*
|
*
|
||||||
* @return self[]
|
* @return self[]
|
||||||
|
* @phpstan-return array<string, self>
|
||||||
*/
|
*/
|
||||||
public static function getAll() : array{
|
public static function getAll() : array{
|
||||||
//phpstan doesn't support generic traits yet :(
|
//phpstan doesn't support generic traits yet :(
|
||||||
|
@ -29,7 +29,10 @@ use function mb_strtoupper;
|
|||||||
use function preg_match;
|
use function preg_match;
|
||||||
|
|
||||||
trait RegistryTrait{
|
trait RegistryTrait{
|
||||||
/** @var object[] */
|
/**
|
||||||
|
* @var object[]
|
||||||
|
* @phpstan-var array<string, object>
|
||||||
|
*/
|
||||||
private static $members = null;
|
private static $members = null;
|
||||||
|
|
||||||
private static function verifyName(string $name) : void{
|
private static function verifyName(string $name) : void{
|
||||||
@ -107,6 +110,7 @@ trait RegistryTrait{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return object[]
|
* @return object[]
|
||||||
|
* @phpstan-return array<string, object>
|
||||||
*/
|
*/
|
||||||
private static function _registryGetAll() : array{
|
private static function _registryGetAll() : array{
|
||||||
self::checkInit();
|
self::checkInit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user