| Conditions | 6 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php namespace Distilleries\PermissionUtil\Helpers; |
||
| 16 | public function hasAccess($key) |
||
| 17 | { |
||
| 18 | if (empty($this->config['auth_restricted'])) { |
||
| 19 | return true; |
||
| 20 | } |
||
| 21 | |||
| 22 | if ($this->auth->check()) { |
||
| 23 | |||
| 24 | $user = $this->auth->user(); |
||
| 25 | $implement = class_implements($user, true); |
||
| 26 | |||
| 27 | if (empty($implement) || empty($implement['Distilleries\PermissionUtil\Contracts\PermissionUtilContract'])) { |
||
| 28 | return true; |
||
| 29 | } |
||
| 30 | |||
| 31 | return (!empty($user)) ? $user->hasAccess($key) : false; |
||
|
|
|||
| 32 | } |
||
| 33 | |||
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 60 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.