mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
and more typehints
This commit is contained in:
@ -35,7 +35,7 @@ class BlockMetadataStore extends MetadataStore{
|
||||
$this->owningLevel = $owningLevel;
|
||||
}
|
||||
|
||||
public function disambiguate(Metadatable $block, $metadataKey){
|
||||
public function disambiguate(Metadatable $block, string $metadataKey) : string{
|
||||
if(!($block instanceof Block)){
|
||||
throw new \InvalidArgumentException("Argument must be a Block instance");
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\entity\Entity;
|
||||
|
||||
class EntityMetadataStore extends MetadataStore{
|
||||
|
||||
public function disambiguate(Metadatable $entity, $metadataKey){
|
||||
public function disambiguate(Metadatable $entity, string $metadataKey) : string{
|
||||
if(!($entity instanceof Entity)){
|
||||
throw new \InvalidArgumentException("Argument must be an Entity instance");
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\level\Level;
|
||||
|
||||
class LevelMetadataStore extends MetadataStore{
|
||||
|
||||
public function disambiguate(Metadatable $level, $metadataKey){
|
||||
public function disambiguate(Metadatable $level, string $metadataKey) : string{
|
||||
if(!($level instanceof Level)){
|
||||
throw new \InvalidArgumentException("Argument must be a Level instance");
|
||||
}
|
||||
|
@ -138,5 +138,5 @@ abstract class MetadataStore{
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
abstract public function disambiguate(Metadatable $subject, $metadataKey);
|
||||
abstract public function disambiguate(Metadatable $subject, string $metadataKey) : string;
|
||||
}
|
@ -27,7 +27,7 @@ use pocketmine\IPlayer;
|
||||
|
||||
class PlayerMetadataStore extends MetadataStore{
|
||||
|
||||
public function disambiguate(Metadatable $player, $metadataKey){
|
||||
public function disambiguate(Metadatable $player, string $metadataKey) : string{
|
||||
if(!($player instanceof IPlayer)){
|
||||
throw new \InvalidArgumentException("Argument must be an IPlayer instance");
|
||||
}
|
||||
|
Reference in New Issue
Block a user