1 | <?php |
||
10 | class People extends Results implements PeopleResultsInterface |
||
11 | { |
||
12 | |||
13 | protected $adult = null; |
||
14 | protected $known_for = null; |
||
15 | protected $name = null; |
||
16 | protected $popularity = null; |
||
17 | protected $profile_path = null; |
||
18 | |||
19 | /** |
||
20 | * Constructor |
||
21 | * @param \vfalies\tmdb\Tmdb $tmdb |
||
22 | * @param \stdClass $result |
||
23 | * @throws \Exception |
||
24 | */ |
||
25 | 6 | public function __construct(Tmdb $tmdb, \stdClass $result) |
|
37 | |||
38 | 1 | public function getId() |
|
42 | |||
43 | 1 | public function getAdult() |
|
47 | |||
48 | /** |
||
49 | * @codeCoverageIgnore |
||
50 | * @throws NotYetImplementedException |
||
51 | */ |
||
52 | public function getKnownFor() |
||
56 | |||
57 | 1 | public function getName() |
|
61 | |||
62 | 1 | public function getPopularity() |
|
66 | |||
67 | 1 | public function getProfilePath() |
|
71 | |||
72 | } |
||
73 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: