DX: fix phpstan issues with more strict type hinting in AuthorizationHelperInterface

This commit is contained in:
Julien Fastré 2023-07-04 16:00:09 +02:00
parent dd344aed52
commit a56370d851
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 7 additions and 4 deletions

View File

@ -161,6 +161,7 @@ class TimelineActivityProvider implements TimelineProviderInterface
// loop on reachable scopes
foreach ($reachableScopes as $scope) {
/** @phpstan-ignore-next-line */
if (in_array($scope->getId(), $scopes_ids, true)) {
continue;
}

View File

@ -360,10 +360,12 @@ final class PersonContext implements PersonContextInterface
private function isScopeNecessary(Person $person): bool
{
if ($this->showScopes && 1 < $this->authorizationHelper->getReachableScopes(
$this->security->getUser(),
PersonDocumentVoter::CREATE,
$this->centerResolverManager->resolveCenters($person)
if ($this->showScopes && 1 < count(
$this->authorizationHelper->getReachableScopes(
$this->security->getUser(),
PersonDocumentVoter::CREATE,
$this->centerResolverManager->resolveCenters($person)
)
)) {
return true;
}