Fixed some PHPStan level 5 issues

This commit is contained in:
Jan Böhmer 2023-06-13 20:24:54 +02:00
parent 74051c5649
commit 19530a9102
35 changed files with 95 additions and 63 deletions

View file

@ -112,7 +112,7 @@ class PermissionManager
/** @var Group $parent */
$parent = $user->getGroup();
while ($parent instanceof AbstractStructuralDBElement) { //The top group, has parent == null
while ($parent instanceof Group) { //The top group, has parent == null
//Check if our current element gives an info about disallow/allow
$allowed = $this->dontInherit($parent, $permission, $operation);
if (null !== $allowed) {

View file

@ -172,12 +172,18 @@ class PermissionPresetsHelper
return $perm_holder;
}
/**
* @phpstan-api
*/
private function AllForbid(HasPermissionsInterface $perm_holder): HasPermissionsInterface
{
$this->permissionResolver->setAllPermissions($perm_holder, PermissionData::DISALLOW);
return $perm_holder;
}
/**
* @phpstan-api
*/
private function AllAllow(HasPermissionsInterface $perm_holder): HasPermissionsInterface
{
$this->permissionResolver->setAllPermissions($perm_holder, PermissionData::ALLOW);