Passed
Push — master ( 4a884d...c9d1fc )
by Jeff
12:14
created

PermissionController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 27
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 7 1
A __construct() 0 3 1
1
<?php
2
3
namespace App\Http\Controllers\Admin\Permissions;
4
5
use App\Http\Controllers\Controller;
6
use App\Shop\Permissions\Repositories\PermissionRepository;
7
8
class PermissionController extends Controller
9
{
10
    /**
11
     * @var PermissionRepository
12
     */
13
    private $permRepo;
14
15
    /**
16
     * PermissionController constructor.
17
     *
18
     * @param PermissionRepository $permissionRepository
19
     */
20
    public function __construct(PermissionRepository $permissionRepository)
21
    {
22
        $this->permRepo = $permissionRepository;
23
    }
24
25
    /**
26
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
27
     */
28
    public function index()
29
    {
30
        $list = $this->permRepo->listPermissions();
31
32
        $permissions = $this->permRepo->paginateArrayResults($list->all());
33
34
        return view('admin.permissions.list', compact('permissions'));
35
    }
36
}
37