Skip to content

Commit 6dc61af

Browse files
Merge pull request #6322 from christianbeeznest/ofaj-22651
User: Prevent type error in hasAuthSourceByAuthentication() - refs BT#22651
2 parents ab07ef5 + a77af5e commit 6dc61af

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/CoreBundle/Entity/User.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,9 +2483,11 @@ public function addAuthSourceByAuthentication(string $authentication, AccessUrl
24832483

24842484
public function hasAuthSourceByAuthentication(string $authentication): bool
24852485
{
2486-
return $this->authSources
2487-
->exists(fn (UserAuthSource $authSource) => $authSource->getAuthentication() === $authentication)
2488-
;
2486+
return $this->authSources->exists(
2487+
fn ($key, $authSource) =>
2488+
$authSource instanceof UserAuthSource &&
2489+
$authSource->getAuthentication() === $authentication
2490+
);
24892491
}
24902492

24912493
public function getAuthSourceByAuthentication(string $authentication): UserAuthSource

0 commit comments

Comments
 (0)