Completed
Push — master ( 8c9c54...6d4889 )
by Elf
44:15
created

DeviceModelAttribute   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 14
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDeviceModelAttribute() 0 6 2
1
<?php
2
3
namespace ElfSundae\Support\Traits\Eloquent;
4
5
use ElfSundae\Support\Facades\Support;
6
7
trait DeviceModelAttribute
8
{
9
    /**
10
     * Get the `device_model` attribute.
11
     *
12
     * @return string|null
13
     */
14
    public function getDeviceModelAttribute()
15
    {
16
        $platform = property_exists($this, 'deviceModelKey') ? $this->deviceModelKey : 'platform';
17
18
        return Support::iDeviceModel($this->{$platform});
19
    }
20
}
21