Passed
Push — master ( 5bd4e8...a1df2d )
by vincent
40s
created

ElementTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 31
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPosterPath() 0 8 2
A getBackdropPath() 0 8 2
1
<?php
2
3
namespace vfalies\tmdb\Traits;
4
5
trait ElementTrait
6
{
7
8
    protected $data = null;
9
    protected $conf = null;
10
11
    /**
12
     * Get poster path
13
     */
14 6
    public function getPosterPath()
15
    {
16 6
        if (isset($this->data->poster_path))
17
        {
18 3
            return $this->data->poster_path;
19
        }
20 3
        return '';
21
    }
22
23
    /**
24
     * Get backdrop
25
     */
26 4
    public function getBackdropPath()
27
    {
28 4
        if (isset($this->data->backdrop_path))
29
        {
30 2
            return $this->data->backdrop_path;
31
        }
32 2
        return '';
33
    }
34
35
}
36