Completed
Push — develop ( 2606e4...9302c9 )
by Neil
04:35
created

Syslog   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 44
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A device() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Syslog extends Model
8
{
9
    /**
10
     * The table associated with the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'devices';
15
16
    /**
17
     * The primary key column name.
18
     *
19
     * @var string
20
     */
21
    protected $primaryKey = 'null';
22
23
    /**
24
     * Indicates if the IDs are auto-incrementing.
25
     *
26
     * @var bool
27
     */
28
    public $incrementing = false;
29
30
    /**
31
     * Indicates if the model should be timestamped.
32
     *
33
     * @var bool
34
     */
35
    public $timestamps = false;
36
37
38
    // ---- Accessors/Mutators ----
39
40
41
    // ---- Define Reletionships ----
42
43
    /**
44
     * Returns the device this entry belongs to.
45
     */
46
    public function device() {
47
        return $this->belongsToOne('App\Models\Device', 'device_id', 'device_id');
0 ignored issues
show
Documentation Bug introduced by
The method belongsToOne does not exist on object<App\Models\Syslog>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
48
    }
49
50
}
51