Completed
Push — master ( d3d242...9eb338 )
by Elf
05:07
created

DeviceModelAttribute   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 2
cp 0
rs 10
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDeviceModelAttribute() 0 4 1
1
<?php
2
3
namespace App\Support\Traits\Eloquent;
4
5
use App\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
        return Helper::iDeviceModel($this->platform);
1 ignored issue
show
Bug introduced by
The property platform does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
17
    }
18
}
19