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

RoleTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 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