OutfitTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 1
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Ps2alerts\Api\Transformer\Metrics;
4
5
use League\Fractal\TransformerAbstract;
6
7
class OutfitTransformer 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
            'outfit'  => [
20
                'id'      => (string) $data['outfitID'], // Bigint
21
                'name'    => (string) $data['outfitName'],
22
                'tag'     => (string) $data['outfitTag'],
23
                'faction' => (int) $data['outfitFaction']
24
            ],
25
            'metrics' => [
26
                'kills'     => (int) $data['outfitKills'],
27
                'deaths'    => (int) $data['outfitDeaths'],
28
                'teamkills' => (int) $data['outfitTKs'],
29
                'suicides'  => (int) $data['outfitSuicides']
30
                // 'captures'  => (int) $data['outfitCaps'], --- CURRENTLY EMPTY AND BROKEN
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
31
            ]
32
        ];
33
    }
34
}
35