add native return types to closures (for phpstan)

This commit is contained in:
Dylan K. Taylor
2020-02-07 22:05:15 +00:00
parent aac7da6c96
commit d2aca6023b
10 changed files with 15 additions and 15 deletions

View File

@ -46,10 +46,10 @@ class CallbackInventoryChangeListener implements InventoryChangeListener{
*/
public function __construct(?\Closure $onSlotChange, ?\Closure $onContentChange){
if($onSlotChange !== null){
Utils::validateCallableSignature(function(Inventory $inventory, int $slot){}, $onSlotChange);
Utils::validateCallableSignature(function(Inventory $inventory, int $slot) : void{}, $onSlotChange);
}
if($onContentChange !== null){
Utils::validateCallableSignature(function(Inventory $inventory){}, $onContentChange);
Utils::validateCallableSignature(function(Inventory $inventory) : void{}, $onContentChange);
}
$this->onSlotChangeCallback = $onSlotChange;