Skip to content

Commit

Permalink
Fix return type of grabSecurityService (#178)
Browse files Browse the repository at this point in the history
Since symfony 6.2 the "security.helper" service is an instance of Symfony\Bundle\SecurityBundle\Security
  • Loading branch information
W0rma committed Jan 10, 2024
1 parent 3f41b87 commit b887260
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Codeception/Module/Symfony/SecurityAssertionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

namespace Codeception\Module\Symfony;

use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\Security as LegacySecurity;
use Symfony\Component\Security\Core\User\UserInterface;
use function sprintf;

Expand Down Expand Up @@ -176,7 +177,7 @@ public function seeUserPasswordDoesNotNeedRehash(UserInterface $user = null): vo
$this->assertFalse($hasher->needsRehash($user), 'User password needs rehash');
}

protected function grabSecurityService(): Security
protected function grabSecurityService(): Security|LegacySecurity
{
return $this->grabService('security.helper');
}
Expand Down

0 comments on commit b887260

Please sign in to comment.