phpstan: use more class-string

This commit is contained in:
Dylan K. Taylor
2020-01-31 22:05:33 +00:00
parent f65bf76fd8
commit 89c6da13ac
7 changed files with 70 additions and 8 deletions

View File

@ -23,6 +23,8 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\tile\Tile;
class BlockIdentifier{
/** @var int */
@ -31,9 +33,15 @@ class BlockIdentifier{
private $variant;
/** @var int|null */
private $itemId;
/** @var string|null */
/**
* @var string|null
* @phpstan-var class-string<Tile>|null
*/
private $tileClass;
/**
* @phpstan-param class-string<Tile>|null $tileClass
*/
public function __construct(int $blockId, int $variant = 0, ?int $itemId = null, ?string $tileClass = null){
$this->blockId = $blockId;
$this->variant = $variant;
@ -60,6 +68,9 @@ class BlockIdentifier{
return $this->itemId ?? ($this->blockId > 255 ? 255 - $this->blockId : $this->blockId);
}
/**
* @phpstan-return class-string<Tile>|null
*/
public function getTileClass() : ?string{
return $this->tileClass;
}