Skip to content

Commit

Permalink
#534 - Psalm fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
turegjorup committed Feb 29, 2024
1 parent f53c6bd commit 3a3e2c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 0 additions & 6 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,6 @@
</MissingParamType>
</file>
<file src="src/Security/AzureOidcAuthenticator.php">
<InvalidNullableReturnType>
<code><![CDATA[User]]></code>
</InvalidNullableReturnType>
<NullableReturnStatement>
<code><![CDATA[$this->entityManager->getRepository(User::class)->findOneBy(['providerId' => $identifier])]]></code>
</NullableReturnStatement>
<RiskyTruthyFalsyComparison>
<code><![CDATA[empty($signInName)]]></code>
</RiskyTruthyFalsyComparison>
Expand Down
8 changes: 5 additions & 3 deletions src/Security/AzureOidcAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class AzureOidcAuthenticator extends OpenIdLoginAuthenticator implements LoggerA

final public const APP_ADMIN_ROLE = Roles::ROLE_ADMIN;
final public const APP_EDITOR_ROLE = Roles::ROLE_EDITOR;

/** @psalm-suppress PropertyNotSetInConstructor */
private LoggerInterface $logger;

public function __construct(
Expand Down Expand Up @@ -208,8 +210,8 @@ private function getTenantKeyWithRole(string $oidcGroup): array
return [$tenantKey, $role];
}

$this->logger->warning('Unknown role for group: '.$oidcGroup, [
'source' => self::class,
]);
$e = new \InvalidArgumentException('Unknown role for group: '.$oidcGroup);
$this->logger->error($e);
throw $e;
}
}

0 comments on commit 3a3e2c0

Please sign in to comment.