Completed
Push — master ( f67f4f...77dcfd )
by Curtis
40s queued 12s
created

Relations   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRelationValue() 0 8 4
1
<?php
2
3
namespace App\Traits\enso\DynamicMethods;
4
5
trait Relations
6
{
7
    use Methods;
8
9
    public function getRelationValue($key)
10
    {
11
        if ($this->relationLoaded($key)) {
0 ignored issues
show
Bug introduced by
The method relationLoaded() does not exist on App\Traits\enso\DynamicMethods\Relations. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

11
        if ($this->/** @scrutinizer ignore-call */ relationLoaded($key)) {
Loading history...
12
            return $this->relations[$key];
13
        }
14
15
        if (isset(static::$dynamicMethods[$key]) || method_exists($this, $key)) {
16
            return $this->getRelationshipFromMethod($key);
0 ignored issues
show
Bug introduced by
The method getRelationshipFromMethod() does not exist on App\Traits\enso\DynamicMethods\Relations. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
            return $this->/** @scrutinizer ignore-call */ getRelationshipFromMethod($key);
Loading history...
17
        }
18
    }
19
}
20