Completed
Push — master ( 12434c...4bb193 )
by Mahmoud
03:16
created

RoleTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 7 1
1
<?php
2
3
namespace App\Containers\Authorization\UI\API\Transformers;
4
5
use App\Containers\Authorization\Models\Role;
6
use App\Port\Transformer\Abstracts\Transformer;
7
8
/**
9
 * Class RoleTransformer.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class RoleTransformer extends Transformer
14
{
15
16
    protected $availableIncludes = [
17
18
    ];
19
20
    protected $defaultIncludes = [
21
22
    ];
23
24
    /**
25
     * @param \App\Containers\User\Models\User $user
0 ignored issues
show
Bug introduced by
There is no parameter named $user. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
26
     *
27
     * @return array
28
     */
29
    public function transform(Role $role)
30
    {
31
        return [
32
            'name' => $role->display_name,
33
            'description'  => $role->description,
34
        ];
35
    }
36
37
}
38