Completed
Push — master ( 7f6fe3...92878a )
by Elf
07:06 queued 05:21
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
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 6
ccs 0
cts 5
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace ElfSundae\Laravel\Support\Traits\Eloquent;
4
5
use ElfSundae\Laravel\Support\Helper;
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 Helper::iDeviceModel($this->{$platform});
19
    }
20
}
21