Modernize private property declarations in src/data

This commit is contained in:
Dylan K. Taylor
2022-05-17 20:35:59 +01:00
parent d11d77d328
commit 343a12626e
5 changed files with 10 additions and 10 deletions

View File

@ -35,12 +35,12 @@ final class CoralTypeIdMap{
* @var CoralType[] * @var CoralType[]
* @phpstan-var array<int, CoralType> * @phpstan-var array<int, CoralType>
*/ */
private $idToEnum = []; private array $idToEnum = [];
/** /**
* @var int[] * @var int[]
* @phpstan-var array<int, int> * @phpstan-var array<int, int>
*/ */
private $enumToId = []; private array $enumToId = [];
public function __construct(){ public function __construct(){
$this->register(BlockLegacyMetadata::CORAL_VARIANT_TUBE, CoralType::TUBE()); $this->register(BlockLegacyMetadata::CORAL_VARIANT_TUBE, CoralType::TUBE());

View File

@ -33,13 +33,13 @@ final class DyeColorIdMap{
* @var DyeColor[] * @var DyeColor[]
* @phpstan-var array<int, DyeColor> * @phpstan-var array<int, DyeColor>
*/ */
private $idToEnum = []; private array $idToEnum = [];
/** /**
* @var int[] * @var int[]
* @phpstan-var array<int, int> * @phpstan-var array<int, int>
*/ */
private $enumToId = []; private array $enumToId = [];
private function __construct(){ private function __construct(){
$this->register(0, DyeColor::WHITE()); $this->register(0, DyeColor::WHITE());

View File

@ -36,13 +36,13 @@ final class EffectIdMap{
* @var Effect[] * @var Effect[]
* @phpstan-var array<int, Effect> * @phpstan-var array<int, Effect>
*/ */
private $idToEffect = []; private array $idToEffect = [];
/** /**
* @var int[] * @var int[]
* @phpstan-var array<int, int> * @phpstan-var array<int, int>
*/ */
private $effectToId = []; private array $effectToId = [];
private function __construct(){ private function __construct(){
$this->register(EffectIds::SPEED, VanillaEffects::SPEED()); $this->register(EffectIds::SPEED, VanillaEffects::SPEED());

View File

@ -39,12 +39,12 @@ final class EnchantmentIdMap{
* @var Enchantment[] * @var Enchantment[]
* @phpstan-var array<int, Enchantment> * @phpstan-var array<int, Enchantment>
*/ */
private $idToEnch = []; private array $idToEnch = [];
/** /**
* @var int[] * @var int[]
* @phpstan-var array<int, int> * @phpstan-var array<int, int>
*/ */
private $enchToId = []; private array $enchToId = [];
private function __construct(){ private function __construct(){
$this->register(EnchantmentIds::PROTECTION, VanillaEnchantments::PROTECTION()); $this->register(EnchantmentIds::PROTECTION, VanillaEnchantments::PROTECTION());

View File

@ -37,12 +37,12 @@ abstract class LegacyToStringBidirectionalIdMap{
* @var string[] * @var string[]
* @phpstan-var array<int, string> * @phpstan-var array<int, string>
*/ */
private $legacyToString = []; private array $legacyToString = [];
/** /**
* @var int[] * @var int[]
* @phpstan-var array<string, int> * @phpstan-var array<string, int>
*/ */
private $stringToLegacy = []; private array $stringToLegacy = [];
public function __construct(string $file){ public function __construct(string $file){
$stringToLegacyId = json_decode(Utils::assumeNotFalse(file_get_contents($file), "Missing required resource file"), true); $stringToLegacyId = json_decode(Utils::assumeNotFalse(file_get_contents($file), "Missing required resource file"), true);