| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | public function getIdentity() |
||
| 50 | { |
||
| 51 | $identity = parent::getIdentity(); |
||
| 52 | // TODO implement |
||
| 53 | |||
| 54 | if (!$identity instanceof UserEntity) { |
||
| 55 | $userName = 'admin'; |
||
| 56 | |||
| 57 | /** @var UserEntity $userEntity */ |
||
| 58 | $userEntity = $this->getDataStorage()->getUserByUserName($userName); |
||
| 59 | |||
| 60 | if (!$userEntity) { |
||
| 61 | $identity = $userName; |
||
| 62 | } else { |
||
| 63 | return $userEntity; |
||
| 64 | } |
||
| 65 | } |
||
| 66 | |||
| 67 | return $identity; |
||
| 68 | } |
||
| 69 | } |
||
| 70 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: