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

@ -237,7 +237,7 @@ class InventoryTransaction{
return $this->matchItems($needItems, $haveItems) and count($this->actions) > 0 and count($haveItems) === 0 and count($needItems) === 0;
}
protected function handleFailed(){
protected function handleFailed() : void{
foreach($this->actions as $action){
$action->onExecuteFail($this->source);
}

View File

@ -74,11 +74,11 @@ class CreativeInventoryAction extends InventoryAction{
return true;
}
public function onExecuteSuccess(Player $source){
public function onExecuteSuccess(Player $source) : void{
}
public function onExecuteFail(Player $source){
public function onExecuteFail(Player $source) : void{
}

View File

@ -61,11 +61,11 @@ class DropItemAction extends InventoryAction{
return $source->dropItem($this->targetItem);
}
public function onExecuteSuccess(Player $source){
public function onExecuteSuccess(Player $source) : void{
}
public function onExecuteFail(Player $source){
public function onExecuteFail(Player $source) : void{
}
}

View File

@ -112,13 +112,13 @@ abstract class InventoryAction{
*
* @param Player $source
*/
abstract public function onExecuteSuccess(Player $source);
abstract public function onExecuteSuccess(Player $source) : void;
/**
* Performs additional actions when this inventory-action did not complete successfully.
*
* @param Player $source
*/
abstract public function onExecuteFail(Player $source);
abstract public function onExecuteFail(Player $source) : void;
}

View File

@ -104,7 +104,7 @@ class SlotChangeAction extends InventoryAction{
*
* @param Player $source
*/
public function onExecuteSuccess(Player $source){
public function onExecuteSuccess(Player $source) : void{
$viewers = $this->inventory->getViewers();
unset($viewers[spl_object_hash($source)]);
$this->inventory->sendSlot($this->inventorySlot, $viewers);
@ -115,7 +115,7 @@ class SlotChangeAction extends InventoryAction{
*
* @param Player $source
*/
public function onExecuteFail(Player $source){
public function onExecuteFail(Player $source) : void{
$this->inventory->sendSlot($this->inventorySlot, $source);
}
}