mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
add typehints to Metadatable interface and implementations, fix missing return for Block->hasMetadata() reported in #1285
This commit is contained in:
@ -32,10 +32,8 @@ interface Metadatable{
|
||||
*
|
||||
* @param string $metadataKey
|
||||
* @param MetadataValue $newMetadataValue
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setMetadata($metadataKey, MetadataValue $newMetadataValue);
|
||||
public function setMetadata(string $metadataKey, MetadataValue $newMetadataValue);
|
||||
|
||||
/**
|
||||
* Returns a list of previously set metadata values from the implementing
|
||||
@ -45,7 +43,7 @@ interface Metadatable{
|
||||
*
|
||||
* @return MetadataValue[]
|
||||
*/
|
||||
public function getMetadata($metadataKey);
|
||||
public function getMetadata(string $metadataKey);
|
||||
|
||||
/**
|
||||
* Tests to see whether the implementing object contains the given
|
||||
@ -55,7 +53,7 @@ interface Metadatable{
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasMetadata($metadataKey);
|
||||
public function hasMetadata(string $metadataKey) : bool;
|
||||
|
||||
/**
|
||||
* Removes the given metadata value from the implementing object's
|
||||
@ -63,9 +61,7 @@ interface Metadatable{
|
||||
*
|
||||
* @param string $metadataKey
|
||||
* @param Plugin $owningPlugin
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeMetadata($metadataKey, Plugin $owningPlugin);
|
||||
public function removeMetadata(string $metadataKey, Plugin $owningPlugin);
|
||||
|
||||
}
|
Reference in New Issue
Block a user