Modernize property declarations in src/world/generator

This commit is contained in:
Dylan K. Taylor
2022-04-28 13:16:21 +01:00
parent 46c504e529
commit ed2a239334
5 changed files with 14 additions and 28 deletions

View File

@ -31,7 +31,7 @@ final class ThreadLocalGeneratorContext{
* @var self[]
* @phpstan-var array<int, self>
*/
private static $contexts = [];
private static array $contexts = [];
public static function register(self $context, int $worldId) : void{
self::$contexts[$worldId] = $context;
@ -45,19 +45,11 @@ final class ThreadLocalGeneratorContext{
return self::$contexts[$worldId] ?? null;
}
/** @var Generator */
private $generator;
/** @var int */
private $worldMinY;
/** @var int */
private $worldMaxY;
public function __construct(Generator $generator, int $worldMinY, int $worldMaxY){
$this->generator = $generator;
$this->worldMinY = $worldMinY;
$this->worldMaxY = $worldMaxY;
}
public function __construct(
private Generator $generator,
private int $worldMinY,
private int $worldMaxY
){}
public function getGenerator() : Generator{ return $this->generator; }