Completed
Pull Request — master (#32)
by Manuel
04:07
created

DeviceTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
crap 2
1
<?php
2
3
namespace PiFinder\Transformers;
4
5
class DeviceTransformer extends Transformer
6
{
7
    public function transform($device)
8
    {
9
        return [
10
            'id'            => $device['id'],
11
            'ip'            => $device['ip'],
12
            'name'          => $device['name'],
13
            'group'         => $device['group'],
14
            'on_home_page'  => $device['public'],
15
            'device_added'  => $device['created_at']->toIso8601String(),
16
            'last_contact'  => $device['updated_at']->toIso8601String(),
17
        ];
18
    }
19
}
20