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

DeviceModelAttribute::getDeviceModelAttribute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
crap 6
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