enchantments = new \SplFixedArray($size); } /** * @param int $slot * @param EnchantmentEntry $entry */ public function setSlot(int $slot, EnchantmentEntry $entry) : void{ $this->enchantments[$slot] = $entry; } /** * @param int $slot * * @return EnchantmentEntry */ public function getSlot(int $slot) : EnchantmentEntry{ return $this->enchantments[$slot]; } public function getSize() : int{ return $this->enchantments->getSize(); } }