Completed
Push — develop-3.0 ( 4fe777...24fc5d )
by Mohamed
09:15
created

Fetcher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getNameDropdown() 0 4 1
A getRolesWithUsers() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tinyissue\Repository\Role;
13
14
use Tinyissue\Model\Role;
15
use Tinyissue\Repository\Repository;
16
17
class Fetcher extends Repository
18
{
19
    public function __construct(Role $model)
20
    {
21
        $this->model = $model;
0 ignored issues
show
Documentation Bug introduced by
It seems like $model of type object<Tinyissue\Model\Role> is incompatible with the declared type object<Tinyissue\Repository\Model> of property $model.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
22
    }
23
24
    public function getNameDropdown()
25
    {
26
        return $this->model->pluck('name', 'id')->prepend('Disabled')->all();
27
    }
28
29
    public function getRolesWithUsers()
30
    {
31
        return $this->model->with('users')->orderBy('id', 'DESC')->get();
32
    }
33
}
34