| Conditions | 3 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function isAvailableForUserAccount(UserAccount $userAccount, ?string $claimLocale): bool |
||
| 46 | { |
||
| 47 | if (null === $this->userAccountManager || !$this->userAccountManager instanceof AuthenticationContextClassReferenceSupport) { |
||
| 48 | return false; |
||
| 49 | } |
||
| 50 | |||
| 51 | return null !== $this->userAccountManager->getAuthenticationContextClassReferenceFor($userAccount); |
||
| 52 | } |
||
| 53 | |||
| 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: