ExampleTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 2 Features 0
Metric Value
eloc 5
c 2
b 2
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fields() 0 7 1
1
<?php
2
3
namespace Modules\Example\Transformers;
4
5
use Modules\Core\Abstracts\TransformerAbstract;
6
7
/**
8
 * Class ExampleTransformer.
9
 */
10
class ExampleTransformer extends TransformerAbstract
11
{
12
    /**
13
     * Transform the Example entity.
14
     *
15
     * @param \Modules\Example\Entities\Example $attribute
16
     *
17
     * @return array
18
     */
19
    public function fields($attribute)
20
    {
21
        return [
22
            'id' => (int) $attribute->id,
23
24
            'name'  => (string) $attribute->name,
25
            'value' => (string) $attribute->value,
26
        ];
27
    }
28
}
29