OutfitTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 18 1
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