OutfitCaptureTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 8 1
1
<?php
2
3
namespace Ps2alerts\Api\Transformer\Profiles;
4
5
use League\Fractal\TransformerAbstract;
6
7
class OutfitCaptureTransformer extends TransformerAbstract
8
{
9
    /**
10
     * The transform method required by Fractal to parse the data and return proper typing and fields.
11
     *
12
     * @param  array $data Data to transform
13
     *
14
     * @return array
15
     */
16
    public function transform($data)
17
    {
18
        return [
19
            'id'       => (int) $data['facility'], // Bigint
20
            'captures' => (int) $data['captures'],
21
            'defences' => (int) $data['defences']
22
        ];
23
    }
24
}
25