add typehints to Metadatable interface and implementations, fix missing return for Block->hasMetadata() reported in #1285

This commit is contained in:
Dylan K. Taylor
2017-08-10 18:02:01 +01:00
parent 82fd3b540e
commit e8bd0c3e09
6 changed files with 35 additions and 37 deletions

View File

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