Code Duplication    Length = 20-20 lines in 2 locations

src/Transformer/AlertTotalTransformer.php 1 location

@@ 7-26 (lines=20) @@
4
5
use League\Fractal\TransformerAbstract;
6
7
class AlertTotalTransformer 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
            'vs'    => (int) $data['vs'],
20
            'nc'    => (int) $data['nc'],
21
            'tr'    => (int) $data['tr'],
22
            'draw'  => (int) $data['draw'],
23
            'total' => (int) $data['total']
24
        ];
25
    }
26
}
27

src/Transformer/Metrics/PopulationTransformer.php 1 location

@@ 7-26 (lines=20) @@
4
5
use League\Fractal\TransformerAbstract;
6
7
class PopulationTransformer 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
            'timestamp' => (int) $data['timestamp'],
20
            'vs'        => (int) $data['popsVS'],
21
            'nc'        => (int) $data['popsNC'],
22
            'tr'        => (int) $data['popsTR'],
23
            'total'     => (int) $data['popsTotal'],
24
        ];
25
    }
26
}
27