Skip to content

Commit

Permalink
chore: PHPstan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Mar 8, 2024
1 parent 16201fe commit e96a763
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/EntityGenerator/src/Attribute/AttributeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AttributeGenerator

/**
* @param string $className
* @param array<string|int, string|int|array> $parameters
* @param array<string|int, string|int|array|null> $parameters
*/
public function __construct(string $className, array $parameters = [])
{
Expand Down
4 changes: 2 additions & 2 deletions lib/EntityGenerator/src/Field/AbstractFieldGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ protected function getFieldAttributes(bool $exclude = false): array
if (!empty($this->field->getDescription())) {
$description .= ': ' . $this->field->getDescription();
}
if ($this->field->isEnum()) {
$enumValues = explode(',', $this->field->getDefaultValues());
if ($this->field->isEnum() && null !== $defaultValues = $this->field->getDefaultValues()) {
$enumValues = explode(',', $defaultValues);
$enumValues = array_filter(array_map('trim', $enumValues));
$openapiContext = [
'type' => 'string',
Expand Down
5 changes: 2 additions & 3 deletions lib/OpenId/src/Authentication/OpenIdAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\CustomCredentials;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
use Symfony\Component\Security\Http\HttpUtils;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
use Symfony\Component\Security\Http\Util\TargetPathTrait;

final class OpenIdAuthenticator extends AbstractAuthenticator
Expand Down Expand Up @@ -274,7 +273,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
{
if ($request->hasSession()) {
$request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception);
$request->getSession()->set(SecurityRequestAttributes::AUTHENTICATION_ERROR, $exception);
}
$url = $this->urlGenerator->generate($this->defaultRoute);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ public function deleteAction(Request $request, int $id, int $realmNodeId): Respo
'node.%node%.left.%realm%',
[
'%node%' => $nodeSource->getTitle(),
'%realm%' => $realmNode->getRealm() ?
$realmNode->getRealm()->getName() :
$this->translator->trans('node.no_realm')
'%realm%' => $realmNode->getRealm()->getName()
]
);
$this->publishConfirmMessage($request, $msg);
Expand Down

0 comments on commit e96a763

Please sign in to comment.