Passed
Push — master ( 74d4a8...9f17d2 )
by
unknown
01:31
created

Element::getBackdropPath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
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\Abstracts;
4
5
abstract class Element
6
{
7
    protected $data = null;
8
    protected $conf = null;
9
10
    /**
11
     * Get poster path
12
     */
13 6
    public function getPosterPath(): string
14
    {
15 6
        if (isset($this->data->poster_path)) {
16 3
            return $this->data->poster_path;
17
        }
18 3
        return '';
19
    }
20
21
    /**
22
     * Get backdrop
23
     */
24 4
    public function getBackdropPath(): string
25
    {
26 4
        if (isset($this->data->backdrop_path)) {
27 2
            return $this->data->backdrop_path;
28
        }
29 2
        return '';
30
    }
31
}
32