Conditions | 3 |
Paths | 3 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | public function isAllowed($parameter = null): bool { |
||
27 | 1 | if($parameter === null) { |
|
28 | 1 | return true; |
|
29 | 1 | } elseif(!is_bool($parameter)) { |
|
30 | 1 | throw new \InvalidArgumentException("Method " . __METHOD__ . " expects boolean as parameter."); |
|
31 | } |
||
32 | 1 | return ($parameter === $this->user->isLoggedIn()); |
|
33 | } |
||
35 | ?> |