RoleRepository::fillData()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 3
nc 4
nop 1
1
<?php namespace Usman\Guardian\Repositories;
2
3
use Usman\Guardian\Repositories\Interfaces\RoleRepositoryInterface;
4
5 View Code Duplication
class RoleRepository extends BaseRepository implements RoleRepositoryInterface {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
7
    /**
8
     * fills the role model data
9
     * 
10
     * @param  array  $data
11
     * @return void       
12
     */
13
    protected function fillData(array $data)
14
    {
15
		$this->model->role_name   = (!empty($data['role_name'])) ? ucfirst($data['role_name']) : $this->model->role_name;
16
		$this->model->description = (!empty($data['description'])) ? $data['description'] : $this->model->description;  
17
    }
18
19
}