DeviceTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 15
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 12 1
1
<?php
2
3
namespace PiFinder\Transformers;
4
5
class DeviceTransformer extends Transformer
6
{
7 11
    public function transform($device)
8
    {
9
        return [
10 11
            'id'            => $device['id'],
11 11
            'ip'            => $device['ip'],
12 11
            'name'          => $device['name'],
13 11
            'group'         => $device['group'],
14 11
            'on_home_page'  => $device['public'],
15 11
            'device_added'  => $device['created_at']->toIso8601String(),
16 11
            'last_contact'  => $device['updated_at']->toIso8601String(),
17
        ];
18
    }
19
}
20