1 | <?php declare(strict_types = 1); |
||
27 | class Media |
||
28 | { |
||
29 | /** |
||
30 | * Tmdb object |
||
31 | * @var TmdbInterface |
||
32 | */ |
||
33 | protected $tmdb = null; |
||
34 | /** |
||
35 | * Configuration |
||
36 | * @var \stdClass |
||
37 | */ |
||
38 | protected $conf = null; |
||
39 | /** |
||
40 | * Logger |
||
41 | * @var \Psr\Log\LoggerInterface |
||
42 | */ |
||
43 | protected $logger = null; |
||
44 | |||
45 | /** |
||
46 | * Constructor |
||
47 | * @param TmdbInterface $tmdb |
||
48 | */ |
||
49 | 3 | public function __construct(TmdbInterface $tmdb) |
|
55 | |||
56 | /** |
||
57 | * Get backdrop url |
||
58 | * @param string $path |
||
59 | * @param string $size |
||
60 | * @return string|null |
||
61 | */ |
||
62 | 3 | public function getBackdropUrl(string $path, string $size = 'w780') : ?string |
|
66 | |||
67 | /** |
||
68 | * Get poster url |
||
69 | * @param string $path |
||
70 | * @param string $size |
||
71 | * @return string|null |
||
72 | */ |
||
73 | 1 | public function getPosterUrl(string $path, string $size = 'w185') : ?string |
|
77 | |||
78 | /** |
||
79 | * Get logos url |
||
80 | * @param string $path |
||
81 | * @param string $size |
||
82 | * @return string|null |
||
83 | */ |
||
84 | 1 | public function getlogoUrl(string $path, string $size = 'w92') : ?string |
|
88 | |||
89 | /** |
||
90 | * Get profile url |
||
91 | * @param string $path |
||
92 | * @param string $size |
||
93 | * @return string|null |
||
94 | */ |
||
95 | 1 | public function getProfileUrl(string $path, string $size = 'w185') : ?string |
|
99 | |||
100 | /** |
||
101 | * Get poster url |
||
102 | * @param string $path |
||
103 | * @param string $size |
||
104 | * @return string |
||
105 | */ |
||
106 | 1 | public function getStillUrl(string $path, string $size = 'w185') : ?string |
|
110 | |||
111 | /** |
||
112 | * Get image url from type and size |
||
113 | * @param string $type |
||
114 | * @param string $size |
||
115 | * @param string $filepath |
||
116 | * @return string |
||
117 | * @throws NotFoundException |
||
118 | * @throws IncorrectParamException |
||
119 | */ |
||
120 | 3 | private function getImage(string $type, string $size, string $filepath) : string |
|
133 | } |
||
134 |