mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
add some phpstan array types
This commit is contained in:
@ -44,13 +44,19 @@ class Flat extends Generator{
|
||||
private $chunk;
|
||||
/** @var Populator[] */
|
||||
private $populators = [];
|
||||
/** @var int[][] */
|
||||
/**
|
||||
* @var int[][]
|
||||
* @phpstan-var array<int, array{0: int, 1: int}>
|
||||
*/
|
||||
private $structure;
|
||||
/** @var int */
|
||||
private $floorLevel;
|
||||
/** @var int */
|
||||
private $biome;
|
||||
/** @var mixed[] */
|
||||
/**
|
||||
* @var mixed[]
|
||||
* @phpstan-var array<string, mixed>
|
||||
*/
|
||||
private $options;
|
||||
/** @var string */
|
||||
private $preset;
|
||||
@ -65,6 +71,7 @@ class Flat extends Generator{
|
||||
|
||||
/**
|
||||
* @param mixed[] $options
|
||||
* @phpstan-param array<string, mixed> $options
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
@ -97,6 +104,8 @@ class Flat extends Generator{
|
||||
|
||||
/**
|
||||
* @return int[][]
|
||||
* @phpstan-return array<int, array{0: int, 1: int}>
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
public static function parseLayers(string $layers) : array{
|
||||
|
@ -58,6 +58,7 @@ abstract class Generator{
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*
|
||||
* @param mixed[] $settings
|
||||
* @phpstan-param array<string, mixed> $settings
|
||||
*/
|
||||
abstract public function __construct(array $settings = []);
|
||||
|
||||
@ -72,6 +73,7 @@ abstract class Generator{
|
||||
|
||||
/**
|
||||
* @return mixed[]
|
||||
* @phpstan-return array<string, mixed>
|
||||
*/
|
||||
abstract public function getSettings() : array;
|
||||
|
||||
|
@ -30,7 +30,10 @@ use function is_subclass_of;
|
||||
use function strtolower;
|
||||
|
||||
final class GeneratorManager{
|
||||
/** @var string[] name => classname mapping */
|
||||
/**
|
||||
* @var string[] name => classname mapping
|
||||
* @phpstan-var array<string, class-string<Generator>>
|
||||
*/
|
||||
private static $list = [];
|
||||
|
||||
/**
|
||||
|
@ -47,6 +47,7 @@ class GeneratorRegisterTask extends AsyncTask{
|
||||
|
||||
/**
|
||||
* @param mixed[] $generatorSettings
|
||||
* @phpstan-param array<string, mixed> $generatorSettings
|
||||
*/
|
||||
public function __construct(Level $level, string $generatorClass, array $generatorSettings = []){
|
||||
$this->generatorClass = $generatorClass;
|
||||
|
@ -54,6 +54,7 @@ class Nether extends Generator{
|
||||
|
||||
/**
|
||||
* @param mixed[] $options
|
||||
* @phpstan-param array<string, mixed> $options
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
|
@ -62,6 +62,7 @@ class Normal extends Generator{
|
||||
|
||||
/**
|
||||
* @param mixed[] $options
|
||||
* @phpstan-param array<string, mixed> $options
|
||||
*
|
||||
* @throws InvalidGeneratorOptionsException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user