Skip to content

Commit b887260

Browse files
authored
Fix return type of grabSecurityService (#178)
Since symfony 6.2 the "security.helper" service is an instance of Symfony\Bundle\SecurityBundle\Security
1 parent 3f41b87 commit b887260

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Codeception/Module/Symfony/SecurityAssertionsTrait.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
namespace Codeception\Module\Symfony;
66

7+
use Symfony\Bundle\SecurityBundle\Security;
78
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
89
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
910
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
10-
use Symfony\Component\Security\Core\Security;
11+
use Symfony\Component\Security\Core\Security as LegacySecurity;
1112
use Symfony\Component\Security\Core\User\UserInterface;
1213
use function sprintf;
1314

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

179-
protected function grabSecurityService(): Security
180+
protected function grabSecurityService(): Security|LegacySecurity
180181
{
181182
return $this->grabService('security.helper');
182183
}

0 commit comments

Comments
 (0)