Permissible->recalculatePermissions() now returns a map of changed permissions with their old values

This commit is contained in:
Dylan K. Taylor 2020-12-02 01:13:19 +00:00
parent 0634426c26
commit f5bb5c1208
3 changed files with 9 additions and 4 deletions

View File

@ -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[]

View File

@ -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;
}
/**

View File

@ -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();
}
/**