| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Lines | 11 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php namespace App\Modules\Roles\Services; |
||
| 26 | View Code Duplication | public function assignPermissions($roleId, $permissionIds) |
|
| 27 | { |
||
| 28 | $role = false; |
||
| 29 | \DB::transaction(function () use ($roleId, $permissionIds, &$role) { |
||
| 30 | $role = $this->repo->find($roleId); |
||
| 31 | $this->repo->detachPermissions($roleId); |
||
| 32 | $this->repo->attachPermissions($roleId, $permissionIds); |
||
| 33 | }); |
||
| 34 | |||
| 35 | return $role; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.