and more typehints

This commit is contained in:
Dylan K. Taylor
2017-07-14 10:56:51 +01:00
parent b9355387da
commit c3b8be3f60
119 changed files with 598 additions and 541 deletions

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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;
}

View File

@ -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");
}