| Conditions | 8 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | protected function parsePermission() |
||
| 30 | { |
||
| 31 | $attribute = collect(); |
||
| 32 | $permissions = $this->getAttribute('permissions'); |
||
| 33 | if (is_array($permissions)) { |
||
| 34 | $option = array_merge($this->defaultPermissions, $permissions); |
||
| 35 | foreach ($option as $key => $item) { |
||
| 36 | $val = $item instanceof \Closure ? $item() : $item; |
||
| 37 | $attribute->put($key, $val ? true : false); |
||
| 38 | } |
||
| 39 | } else { |
||
| 40 | $val = $permissions instanceof \Closure ? $permissions() : $permissions; |
||
| 41 | foreach ($this->defaultPermissions as $key => $item) { |
||
| 42 | $attribute->put($key, $val ? true : false); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | $this->setAttribute('permissions', $attribute->toArray()); |
||
| 46 | } |
||
| 47 | |||
| 58 |
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.