| Total Complexity | 3 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class MediaPolicy extends Policy |
||
| 17 | { |
||
| 18 | /* ----------------------------------------------------------------- |
||
| 19 | | Getters |
||
| 20 | | ----------------------------------------------------------------- |
||
| 21 | */ |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get the ability's prefix. |
||
| 25 | * |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | protected static function prefix(): string |
||
| 29 | { |
||
| 30 | return 'admin::media.'; |
||
| 31 | } |
||
| 32 | |||
| 33 | /* ----------------------------------------------------------------- |
||
| 34 | | Main Methods |
||
| 35 | | ----------------------------------------------------------------- |
||
| 36 | */ |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the policy's abilities. |
||
| 40 | * |
||
| 41 | * @return \Arcanedev\LaravelPolicies\Ability[]|iterable |
||
| 42 | */ |
||
| 43 | public function abilities(): iterable |
||
| 44 | { |
||
| 45 | $this->setMetas([ |
||
| 46 | 'category' => 'Media', |
||
| 47 | ]); |
||
| 48 | |||
| 49 | return [ |
||
| 50 | |||
| 51 | // admin::media.index |
||
| 52 | $this->makeAbility('index')->setMetas([ |
||
| 53 | 'name' => 'Access the main media manager', |
||
| 54 | 'description' => 'Ability to access the main media manager', |
||
| 55 | ]), |
||
| 56 | |||
| 57 | ]; |
||
| 58 | } |
||
| 59 | |||
| 60 | /* ----------------------------------------------------------------- |
||
| 61 | | Policies |
||
| 62 | | ----------------------------------------------------------------- |
||
| 63 | */ |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Allow to access the main media manager. |
||
| 67 | * |
||
| 68 | * @param \Arcanesoft\Foundation\Auth\Models\Administrator|mixed $administrator |
||
| 69 | * |
||
| 70 | * @return \Illuminate\Auth\Access\Response|bool|void |
||
| 71 | */ |
||
| 72 | public function index(Administrator $administrator) |
||
| 74 | // |
||
| 75 | } |
||
| 76 | } |
||
| 77 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.