| Conditions | 2 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 70 | private function resolveByEmailOrByNick(String $createdByIdentifier) |
||
| 71 | { |
||
| 72 | try { |
||
| 73 | $email = new EmailAddress($createdByIdentifier->toNative()); |
||
|
|
|||
| 74 | $userId = $this->users->byEmail($email); |
||
| 75 | } catch (InvalidNativeArgumentException $e) { |
||
| 76 | $userId = $this->users->byNick($createdByIdentifier); |
||
| 77 | } |
||
| 78 | |||
| 79 | return $userId; |
||
| 80 | } |
||
| 81 | } |
||
| 82 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: