| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public static function check($class = null, $action = 'view') |
||
| 19 | { |
||
| 20 | if (!$class) { |
||
|
|
|||
| 21 | return \Auth::user()->is_admin; |
||
| 22 | } |
||
| 23 | |||
| 24 | if ((new \ReflectionClass(new $class()))->implementsInterface(\LaravelFlare\Flare\Contracts\Permissions\Permissionable::class)) { |
||
| 25 | return \Auth::user()->can($action, $class); |
||
| 26 | } |
||
| 27 | |||
| 28 | return \Auth::user()->is_admin; |
||
| 29 | } |
||
| 30 | |||
| 51 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: