Completed
Pull Request — master (#23)
by vincent
04:12 queued 02:01
created

Company::getHomePage()   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
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
namespace vfalies\tmdb\Items;
4
5
use vfalies\tmdb\Abstracts\Item;
6
use vfalies\tmdb\Interfaces\Items\CompanyInterface;
7
use vfalies\tmdb\Tmdb;
8
9
class Company extends Item implements CompanyInterface
10
{
11
    /**
12
     * Constructor
13
     * @param \vfalies\tmdb\Tmdb $tmdb
14
     * @param int $company_id
15
     * @param array $options
16
     */
17 14
    public function __construct(Tmdb $tmdb, $company_id, array $options = array())
18
    {
19 14
        parent::__construct($tmdb, $company_id, $options, 'company');
20 13
    }
21
22 2
    public function getDescription()
23
    {
24 2
        if (isset($this->data->description)) {
25 1
            return $this->data->description;
26
        }
27 1
        return '';
28
    }
29
30 2
    public function getHeadQuarters()
31
    {
32 2
        if (isset($this->data->headquarters)) {
33 1
            return $this->data->headquarters;
34
        }
35 1
        return '';
36
    }
37
38 2
    public function getHomePage()
39
    {
40 2
        if (isset($this->data->homepage)) {
41 1
            return $this->data->homepage;
42
        }
43 1
        return '';
44
    }
45
46 3
    public function getId()
47
    {
48 3
        if (isset($this->data->id)) {
49 2
            return $this->data->id;
50
        }
51 1
        return 0;
52
    }
53
54 2
    public function getLogoPath()
55
    {
56 2
        if (isset($this->data->logo_path)) {
57 1
            return $this->data->logo_path;
58
        }
59 1
        return '';
60
    }
61
62 2
    public function getName()
63
    {
64 2
        if (isset($this->data->name)) {
65 1
            return $this->data->name;
66
        }
67 1
        return '';
68
    }
69
70
}
71