Passed
Branch master (465d67)
by vincent
02:35
created

People::getKnownFor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * This file is part of the Tmdb package.
4
 *
5
 * (c) Vincent Faliès <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author Vincent Faliès <[email protected]>
11
 * @copyright Copyright (c) 2017
12
 */
13
14
15
namespace vfalies\tmdb\Results;
16
17
use vfalies\tmdb\Abstracts\Results;
18
use vfalies\tmdb\Interfaces\Results\PeopleResultsInterface;
19
use vfalies\tmdb\Exceptions\NotYetImplementedException;
20
use vfalies\tmdb\Interfaces\TmdbInterface;
21
22
/**
23
 * People class
24
 * @package Tmdb
25
 * @author Vincent Faliès <[email protected]>
26
 * @copyright Copyright (c) 2017
27
 */
28
class People extends Results implements PeopleResultsInterface
29
{
30
    /**
31
     * Adult
32
     * @var string
33
     */
34
    protected $adult = null;
35
    /**
36
     * People known for
37
     * @var array
38
     */
39
    protected $known_for = null;
40
    /**
41
     * People name
42
     * @var string
43
     */
44
    protected $name = null;
45
    /**
46
     * Popularity
47
     * @var int
48
     */
49
    protected $popularity = null;
50
    /**
51
     * Image profile path
52
     * @var string
53
     */
54
    protected $profile_path = null;
55
    /**
56
     * Id
57
     * @var int
58
     */
59
    protected $id = null;
60
61
    /**
62
     * Constructor
63
     * @param \vfalies\tmdb\Interfaces\TmdbInterface $tmdb
64
     * @param \stdClass $result
65
     * @throws \Exception
66
     */
67 6
    public function __construct(TmdbInterface $tmdb, \stdClass $result)
68
    {
69 6
        parent::__construct($tmdb, $result);
70
71
        // Populate data
72 6
        $this->id           = $this->data->id;
73 6
        $this->adult        = $this->data->adult;
74 6
        $this->known_for    = $this->data->known_for;
75 6
        $this->name         = $this->data->name;
76 6
        $this->popularity   = $this->data->popularity;
77 6
        $this->profile_path = $this->data->profile_path;
78 6
    }
79
80
    /**
81
     * Get Id
82
     * @return int
83
     */
84 1
    public function getId()
85
    {
86 1
        return (int) $this->id;
87
    }
88
89
    /**
90
     * Get Adult
91
     * @return string
92
     */
93 1
    public function getAdult()
94
    {
95 1
        return $this->adult;
96
    }
97
98
    /**
99
     * People name
100
     * @return string
101
     */
102 1
    public function getName()
103
    {
104 1
        return $this->name;
105
    }
106
107
    /**
108
     * People Popularity
109
     * @return string
110
     */
111 1
    public function getPopularity()
112
    {
113 1
        return $this->popularity;
114
    }
115
116
    /**
117
     * Image profile path
118
     * @return string
119
     */
120 1
    public function getProfilePath()
121
    {
122 1
        return $this->profile_path;
123
    }
124
125
}
126