1 | <?php |
||
20 | final class AuthenticationContextClassReference implements Claim |
||
21 | { |
||
22 | private const CLAIM_NAME = 'acr'; |
||
23 | |||
24 | /** |
||
25 | * @var UserAccountManager|AuthenticationContextClassReferenceSupport |
||
26 | */ |
||
27 | private $userAccountManager; |
||
28 | |||
29 | public function __construct(UserAccountManager $userAccountManager) |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | public function name(): string |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function isAvailableForUserAccount(UserAccount $userAccount, ?string $claimLocale): bool |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function getForUserAccount(UserAccount $userAccount, ?string $claimLocale) |
||
61 | } |
||
62 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: