Enchantment: apply typehints to PHP 7.2 standards

This commit is contained in:
Dylan K. Taylor
2018-05-23 17:28:40 +01:00
parent fbf760bafe
commit 164ce76ff5
3 changed files with 19 additions and 16 deletions

View File

@ -26,30 +26,31 @@ namespace pocketmine\item\enchantment;
class EnchantmentList{
/** @var EnchantmentEntry[] */
/** @var \SplFixedArray|EnchantmentEntry[] */
private $enchantments;
public function __construct($size){
public function __construct(int $size){
$this->enchantments = new \SplFixedArray($size);
}
/**
* @param $slot
* @param int $slot
* @param EnchantmentEntry $entry
*/
public function setSlot($slot, EnchantmentEntry $entry){
public function setSlot(int $slot, EnchantmentEntry $entry) : void{
$this->enchantments[$slot] = $entry;
}
/**
* @param $slot
* @param int $slot
*
* @return EnchantmentEntry
*/
public function getSlot($slot){
public function getSlot(int $slot) : EnchantmentEntry{
return $this->enchantments[$slot];
}
public function getSize(){
public function getSize() : int{
return $this->enchantments->getSize();
}