| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 45 | public function getLoggedUser() |
||
| 46 | { |
||
| 47 | if (null === $this->loggedUser) { |
||
| 48 | $this->loggedUser = auth()->user(); |
||
| 49 | } |
||
| 50 | |||
| 51 | if (!$this->loggedUser instanceof User) { |
||
| 52 | throw new \DomainException('Unable to find a valid instance of logged user.'); |
||
| 53 | } |
||
| 54 | |||
| 55 | return $this->loggedUser; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |