RoleOptionsComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A compose() 0 4 1
1
<?php namespace Usman\Guardian\Composers;
2
3
use Usman\Guardian\Repositories\Interfaces\RoleRepositoryInterface as RoleRepository;
4
5
class RoleOptionsComposer {
6
7
	/**
8
	 * The role repository implementation.
9
	 * 
10
	 * @var RoleRepository
11
	 */
12
    protected $role;
13
14
    /**
15
     * Creates a new instance of RoleOptionsComposer.
16
     * 
17
     * @param RoleRepositoryInterface $role
18
     */
19
    public function __construct(RoleRepository $role)
20
    {
21
        $this->role = $role;
22
    }
23
24
    /**
25
     * Binds the role options to the view
26
     * 
27
     * @param  View $view
28
     * @return void
29
     */
30
    public function compose($view)
31
    {
32
        $view->roles = $this->role->getAll(['id','role_name']);
33
    }
34
}