Passed
Push — master ( a1df2d...f4dfaa )
by vincent
06:17 queued 24s
created

ElementTrait::getBackdropPath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 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