Fixed some doc issues

This commit is contained in:
Dylan K. Taylor
2017-06-04 14:27:30 +01:00
parent eda7965f86
commit 2f4943ac90
5 changed files with 10 additions and 15 deletions

View File

@ -243,14 +243,11 @@ abstract class BaseInventory implements Inventory{
return false;
}
public function addItem(...$slots){
public function addItem(Item ...$slots){
/** @var Item[] $itemSlots */
/** @var Item[] $slots */
$itemSlots = [];
foreach($slots as $slot){
if(!($slot instanceof Item)){
throw new \InvalidArgumentException("Expected Item[], got " . gettype($slot));
}
if($slot->getId() !== 0 and $slot->getCount() > 0){
$itemSlots[] = clone $slot;
}
@ -303,14 +300,11 @@ abstract class BaseInventory implements Inventory{
return $itemSlots;
}
public function removeItem(...$slots){
public function removeItem(Item ...$slots){
/** @var Item[] $itemSlots */
/** @var Item[] $slots */
$itemSlots = [];
foreach($slots as $slot){
if(!($slot instanceof Item)){
throw new \InvalidArgumentException("Expected Item[], got " . gettype($slot));
}
if($slot->getId() !== 0 and $slot->getCount() > 0){
$itemSlots[] = clone $slot;
}

View File

@ -68,11 +68,11 @@ interface Inventory{
*
* Returns the Items that did not fit.
*
* @param Item ...$slots
* @param Item[] ...$slots
*
* @return Item[]
*/
public function addItem(...$slots);
public function addItem(Item ...$slots);
/**
* Checks if a given Item can be added to the inventory
@ -87,11 +87,11 @@ interface Inventory{
* Removes the given Item from the inventory.
* It will return the Items that couldn't be removed.
*
* @param Item ...$slots
* @param Item[] ...$slots
*
* @return Item[]
*/
public function removeItem(...$slots);
public function removeItem(Item ...$slots);
/**
* @return Item[]