mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 05:08:36 +00:00
Permissible->recalculatePermissions() now returns a map of changed permissions with their old values
This commit is contained in:
parent
0634426c26
commit
f5bb5c1208
@ -66,7 +66,11 @@ interface Permissible{
|
|||||||
|
|
||||||
public function removeAttachment(PermissionAttachment $attachment) : void;
|
public function removeAttachment(PermissionAttachment $attachment) : void;
|
||||||
|
|
||||||
public function recalculatePermissions() : void;
|
/**
|
||||||
|
* @return bool[] changed permission name => old value
|
||||||
|
* @phpstan-return array<string, bool>
|
||||||
|
*/
|
||||||
|
public function recalculatePermissions() : array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Set|\Closure[]
|
* @return Set|\Closure[]
|
||||||
|
@ -129,7 +129,7 @@ class PermissibleBase implements Permissible{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recalculatePermissions() : void{
|
public function recalculatePermissions() : array{
|
||||||
Timings::$permissibleCalculationTimer->startTiming();
|
Timings::$permissibleCalculationTimer->startTiming();
|
||||||
|
|
||||||
$permManager = PermissionManager::getInstance();
|
$permManager = PermissionManager::getInstance();
|
||||||
@ -179,6 +179,7 @@ class PermissibleBase implements Permissible{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Timings::$permissibleCalculationTimer->stopTiming();
|
Timings::$permissibleCalculationTimer->stopTiming();
|
||||||
|
return $diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,8 +67,8 @@ trait PermissibleDelegateTrait{
|
|||||||
$this->perm->removeAttachment($attachment);
|
$this->perm->removeAttachment($attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recalculatePermissions() : void{
|
public function recalculatePermissions() : array{
|
||||||
$this->perm->recalculatePermissions();
|
return $this->perm->recalculatePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user