| Conditions | 5 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 10.3999 |
| Changes | 3 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 17 | 2 | public function enabledAsLabel(): string |
|
| 18 | { |
||
| 19 | // Avoid showing enabled state if there is an invitation pending |
||
| 20 | 2 | if ($this->user->invitation->last()) { |
|
| 21 | $state = $this->user->invitation->last()->state(); |
||
| 22 | if ($state == 'pending') { |
||
| 23 | return '<span class="label label-primary">Uitgenodigd</span>'; |
||
| 24 | } elseif ($state == 'denied') { |
||
| 25 | return '<span class="label label-error">Geblokkeerd</span>'; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | 2 | return $this->user->isEnabled() |
|
| 30 | ? '' |
||
| 31 | 2 | : '<span class="label label-error">Geblokkeerd</span>'; |
|
| 32 | } |
||
| 34 |