mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
null and void typehints
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -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{
|
||||
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user