null and void typehints

This commit is contained in:
Dylan K. Taylor
2017-09-21 12:54:04 +01:00
parent d89b8cf12e
commit f01ce8e994
21 changed files with 56 additions and 56 deletions

View File

@ -106,7 +106,7 @@ abstract class BaseInventory implements Inventory{
* @param Item[] $items
* @param bool $send
*/
public function setContents(array $items, bool $send = true){
public function setContents(array $items, bool $send = true) : void{
if(count($items) > $this->getSize()){
$items = array_slice($items, 0, $this->getSize(), true);
}
@ -180,7 +180,7 @@ abstract class BaseInventory implements Inventory{
return $slots;
}
public function remove(Item $item){
public function remove(Item $item) : void{
$checkDamage = !$item->hasAnyDamageValue();
$checkTags = $item->hasCompoundTag();
@ -334,7 +334,7 @@ abstract class BaseInventory implements Inventory{
return $this->setItem($index, ItemFactory::get(Item::AIR, 0, 0), $send);
}
public function clearAll(){
public function clearAll() : void{
for($i = 0, $size = $this->getSize(); $i < $size; ++$i){
$this->clear($i, false);
}
@ -353,7 +353,7 @@ abstract class BaseInventory implements Inventory{
return $this->holder;
}
public function setMaxStackSize(int $size){
public function setMaxStackSize(int $size) : void{
$this->maxStackSize = $size;
}
@ -367,19 +367,19 @@ abstract class BaseInventory implements Inventory{
return true;
}
public function close(Player $who){
public function close(Player $who) : void{
$this->onClose($who);
}
public function onOpen(Player $who){
public function onOpen(Player $who) : void{
$this->viewers[spl_object_hash($who)] = $who;
}
public function onClose(Player $who){
public function onClose(Player $who) : void{
unset($this->viewers[spl_object_hash($who)]);
}
public function onSlotChange(int $index, Item $before, bool $send){
public function onSlotChange(int $index, Item $before, bool $send) : void{
if($send){
$this->sendSlot($index, $this->getViewers());
}
@ -389,7 +389,7 @@ abstract class BaseInventory implements Inventory{
/**
* @param Player|Player[] $target
*/
public function sendContents($target){
public function sendContents($target) : void{
if($target instanceof Player){
$target = [$target];
}
@ -415,7 +415,7 @@ abstract class BaseInventory implements Inventory{
* @param int $index
* @param Player|Player[] $target
*/
public function sendSlot(int $index, $target){
public function sendSlot(int $index, $target) : void{
if($target instanceof Player){
$target = [$target];
}