mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +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 recalculatePermissions() : void;
|
||||
/**
|
||||
* @return bool[] changed permission name => old value
|
||||
* @phpstan-return array<string, bool>
|
||||
*/
|
||||
public function recalculatePermissions() : array;
|
||||
|
||||
/**
|
||||
* @return Set|\Closure[]
|
||||
|
@ -129,7 +129,7 @@ class PermissibleBase implements Permissible{
|
||||
|
||||
}
|
||||
|
||||
public function recalculatePermissions() : void{
|
||||
public function recalculatePermissions() : array{
|
||||
Timings::$permissibleCalculationTimer->startTiming();
|
||||
|
||||
$permManager = PermissionManager::getInstance();
|
||||
@ -179,6 +179,7 @@ class PermissibleBase implements Permissible{
|
||||
});
|
||||
|
||||
Timings::$permissibleCalculationTimer->stopTiming();
|
||||
return $diff;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,8 +67,8 @@ trait PermissibleDelegateTrait{
|
||||
$this->perm->removeAttachment($attachment);
|
||||
}
|
||||
|
||||
public function recalculatePermissions() : void{
|
||||
$this->perm->recalculatePermissions();
|
||||
public function recalculatePermissions() : array{
|
||||
return $this->perm->recalculatePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user