1 | <?php declare(strict_types=1); |
||
27 | abstract class Account |
||
28 | { |
||
29 | use GeneratorTrait; |
||
30 | |||
31 | /** |
||
32 | * Tmdb object |
||
33 | * @var TmdbInterface |
||
34 | */ |
||
35 | protected $tmdb = null; |
||
36 | /** |
||
37 | * Logger |
||
38 | * @var \Psr\Log\LoggerInterface |
||
39 | */ |
||
40 | protected $logger = null; |
||
41 | /** |
||
42 | * Session_id string |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $auth = null; |
||
46 | /** |
||
47 | * Account id |
||
48 | * @var int |
||
49 | */ |
||
50 | protected $account_id; |
||
51 | /** |
||
52 | * Configuration array |
||
53 | * @var \stdClass |
||
54 | */ |
||
55 | protected $conf = null; |
||
56 | /** |
||
57 | * Options |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $options = []; |
||
61 | /** |
||
62 | * Constructor |
||
63 | * @param TmdbInterface $tmdb |
||
64 | * @param string $session_id |
||
65 | * @param int $account_id |
||
66 | * @param array $options |
||
67 | */ |
||
68 | 28 | public function __construct(TmdbInterface $tmdb, string $session_id, int $account_id, array $options = array()) |
|
79 | |||
80 | /** |
||
81 | * Add or remove item in list |
||
82 | * @param string $list_type Type of list (possible value : favorite / watchlist) |
||
83 | * @param string $media_type type of media (movie / tv) |
||
84 | * @param int $media_id media_id |
||
85 | * @param bool $add add or remove item in list |
||
86 | */ |
||
87 | 10 | protected function setListItem(string $list_type, string $media_type, int $media_id, bool $add) |
|
102 | |||
103 | /** |
||
104 | * Get account favorite items |
||
105 | * @param string $list_type type of list (possible value : favorite, rated, watchlist) |
||
106 | * @param string $item item name, possible value : movies , tv , tv/episodes |
||
107 | * @param string $result_class class for the results |
||
108 | * @return \Generator |
||
109 | */ |
||
110 | 7 | protected function getAccountListItems(string $list_type, string $item, string $result_class) : \Generator |
|
120 | } |
||
121 |
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: