DX: fix phpstan errors

This commit is contained in:
2023-02-04 01:19:34 +01:00
parent 856eea37ee
commit 584ac05b53
12 changed files with 34 additions and 136 deletions

View File

@@ -225,10 +225,9 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
$personToCenter = $metadataPerson->getAssociationMapping('center')['joinColumns'][0]['name'];
// acls:
$role = new Role(ActivityVoter::SEE);
$reachableCenters = $this->authorizationHelper->getReachableCenters(
$this->tokenStorage->getToken()->getUser(),
$role
ActivityVoter::SEE
);
if (count($reachableCenters) === 0) {
@@ -239,7 +238,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
if ('person' === $context) {
// we start with activities having the person_id linked to person
$where .= sprintf('%s = ? AND ', $activityToPerson);
$parameters[] = $person->getId();
$parameters[] = $args['context']->getId();
}
// we add acl (reachable center and scopes)
@@ -252,7 +251,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
continue;
}
// we get all the reachable scopes for this center
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), ActivityVoter::SEE, $center);
// we get the ids for those scopes
$reachablesScopesId = array_map(
static function (Scope $scope) {