Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 53 |
|
0.00% |
0 / 51 |
CRAP | |
0.00% |
0 / 1 |
| OmdbApiModel | |
0.00% |
0 / 53 |
|
0.00% |
0 / 51 |
2756 | |
0.00% |
0 / 1 |
| getError | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPoster | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| getTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getYear | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRated | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getReleased | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRuntime | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getGenre | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDirector | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getWriter | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getActors | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPlot | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLanguage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getCountry | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getAwards | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRatings | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getMetascore | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getImdbRating | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getImdbVotes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getImdbId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDvd | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBoxOffice | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getProduction | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getWebsite | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getResponse | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setYear | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRated | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setReleased | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRuntime | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setGenre | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDirector | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setWriter | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setActors | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setPlot | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setLanguage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setCountry | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setAwards | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setPoster | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRatings | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setMetascore | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setImdbRating | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setImdbVotes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setImdbId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDvd | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBoxOffice | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setProduction | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setWebsite | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setResponse | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | class OmdbApiModel |
| 6 | { |
| 7 | public const REPONSE_FALSE = "False"; |
| 8 | public const RESPONSE_TRUE = "True"; |
| 9 | public const DEFAULT_POSTER = "https://amc-theatres-res.cloudinary.com/amc-cdn/static/images/fallbacks/DefaultOneSheetPoster.jpg"; |
| 10 | |
| 11 | private string $title; |
| 12 | private string $year; |
| 13 | private string $rated; |
| 14 | private string $released; |
| 15 | private string $runtime; |
| 16 | private string $genre; |
| 17 | private string $director; |
| 18 | private string $writer; |
| 19 | private string $actors; |
| 20 | private string $plot; |
| 21 | private string $language; |
| 22 | private string $country; |
| 23 | private string $awards; |
| 24 | private string $poster; |
| 25 | /** @var OmdbApiRatingModel[] */ |
| 26 | private array $ratings; |
| 27 | private string $metascore; |
| 28 | private string $imdbRating; |
| 29 | private string $imdbVotes; |
| 30 | private string $imdbId; |
| 31 | private string $type; |
| 32 | private string $dvd; |
| 33 | private string $boxOffice; |
| 34 | private string $production; |
| 35 | private string $website; |
| 36 | private string $response; |
| 37 | private $error; |
| 38 | |
| 39 | public function getError(): string |
| 40 | { |
| 41 | return $this->error; |
| 42 | } |
| 43 | |
| 44 | public function getPoster(): string |
| 45 | { |
| 46 | if ($this->response === OmdbApiModel::REPONSE_FALSE) |
| 47 | { |
| 48 | return OmdbApiModel::DEFAULT_POSTER; |
| 49 | } |
| 50 | return $this->poster; |
| 51 | } |
| 52 | |
| 53 | |
| 54 | public function getTitle(): string |
| 55 | { |
| 56 | return $this->title; |
| 57 | } |
| 58 | |
| 59 | public function getYear(): string |
| 60 | { |
| 61 | return $this->year; |
| 62 | } |
| 63 | |
| 64 | public function getRated(): string |
| 65 | { |
| 66 | return $this->rated; |
| 67 | } |
| 68 | |
| 69 | public function getReleased(): string |
| 70 | { |
| 71 | return $this->released; |
| 72 | } |
| 73 | |
| 74 | public function getRuntime(): string |
| 75 | { |
| 76 | return $this->runtime; |
| 77 | } |
| 78 | |
| 79 | public function getGenre(): string |
| 80 | { |
| 81 | return $this->genre; |
| 82 | } |
| 83 | |
| 84 | public function getDirector(): string |
| 85 | { |
| 86 | return $this->director; |
| 87 | } |
| 88 | |
| 89 | public function getWriter(): string |
| 90 | { |
| 91 | return $this->writer; |
| 92 | } |
| 93 | |
| 94 | public function getActors(): string |
| 95 | { |
| 96 | return $this->actors; |
| 97 | } |
| 98 | |
| 99 | public function getPlot(): string |
| 100 | { |
| 101 | return $this->plot; |
| 102 | } |
| 103 | |
| 104 | public function getLanguage(): string |
| 105 | { |
| 106 | return $this->language; |
| 107 | } |
| 108 | |
| 109 | public function getCountry(): string |
| 110 | { |
| 111 | return $this->country; |
| 112 | } |
| 113 | |
| 114 | public function getAwards(): string |
| 115 | { |
| 116 | return $this->awards; |
| 117 | } |
| 118 | |
| 119 | |
| 120 | /** |
| 121 | * @return OmdbApiRatingModel[] |
| 122 | */ |
| 123 | public function getRatings(): array |
| 124 | { |
| 125 | return $this->ratings; |
| 126 | } |
| 127 | |
| 128 | public function getMetascore(): string |
| 129 | { |
| 130 | return $this->metascore; |
| 131 | } |
| 132 | |
| 133 | public function getImdbRating(): string |
| 134 | { |
| 135 | return $this->imdbRating; |
| 136 | } |
| 137 | |
| 138 | public function getImdbVotes(): string |
| 139 | { |
| 140 | return $this->imdbVotes; |
| 141 | } |
| 142 | |
| 143 | public function getImdbId(): string |
| 144 | { |
| 145 | return $this->imdbId; |
| 146 | } |
| 147 | |
| 148 | public function getType(): string |
| 149 | { |
| 150 | return $this->type; |
| 151 | } |
| 152 | |
| 153 | public function getDvd(): string |
| 154 | { |
| 155 | return $this->dvd; |
| 156 | } |
| 157 | |
| 158 | public function getBoxOffice(): string |
| 159 | { |
| 160 | return $this->boxOffice; |
| 161 | } |
| 162 | |
| 163 | public function getProduction(): string |
| 164 | { |
| 165 | return $this->production; |
| 166 | } |
| 167 | |
| 168 | public function getWebsite(): string |
| 169 | { |
| 170 | return $this->website; |
| 171 | } |
| 172 | |
| 173 | public function getResponse(): string |
| 174 | { |
| 175 | return $this->response; |
| 176 | } |
| 177 | |
| 178 | public function setTitle(string $title): void |
| 179 | { |
| 180 | $this->title = $title; |
| 181 | } |
| 182 | |
| 183 | public function setYear(string $year): void |
| 184 | { |
| 185 | $this->year = $year; |
| 186 | } |
| 187 | |
| 188 | public function setRated(string $rated): void |
| 189 | { |
| 190 | $this->rated = $rated; |
| 191 | } |
| 192 | |
| 193 | public function setReleased(string $released): void |
| 194 | { |
| 195 | $this->released = $released; |
| 196 | } |
| 197 | |
| 198 | public function setRuntime(string $runtime): void |
| 199 | { |
| 200 | $this->runtime = $runtime; |
| 201 | } |
| 202 | |
| 203 | public function setGenre(string $genre): void |
| 204 | { |
| 205 | $this->genre = $genre; |
| 206 | } |
| 207 | |
| 208 | public function setDirector(string $director): void |
| 209 | { |
| 210 | $this->director = $director; |
| 211 | } |
| 212 | |
| 213 | public function setWriter(string $writer): void |
| 214 | { |
| 215 | $this->writer = $writer; |
| 216 | } |
| 217 | |
| 218 | public function setActors(string $actors): void |
| 219 | { |
| 220 | $this->actors = $actors; |
| 221 | } |
| 222 | |
| 223 | public function setPlot(string $plot): void |
| 224 | { |
| 225 | $this->plot = $plot; |
| 226 | } |
| 227 | |
| 228 | public function setLanguage(string $language): void |
| 229 | { |
| 230 | $this->language = $language; |
| 231 | } |
| 232 | |
| 233 | public function setCountry(string $country): void |
| 234 | { |
| 235 | $this->country = $country; |
| 236 | } |
| 237 | |
| 238 | public function setAwards(string $awards): void |
| 239 | { |
| 240 | $this->awards = $awards; |
| 241 | } |
| 242 | |
| 243 | public function setPoster(string $poster): void |
| 244 | { |
| 245 | $this->poster = $poster; |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * @param OmdbApiRatingModel[] $ratings |
| 250 | */ |
| 251 | public function setRatings(array $ratings): void |
| 252 | { |
| 253 | $this->ratings = $ratings; |
| 254 | } |
| 255 | |
| 256 | public function setMetascore(string $metascore): void |
| 257 | { |
| 258 | $this->metascore = $metascore; |
| 259 | } |
| 260 | |
| 261 | public function setImdbRating(string $imdbRating): void |
| 262 | { |
| 263 | $this->imdbRating = $imdbRating; |
| 264 | } |
| 265 | |
| 266 | public function setImdbVotes(string $imdbVotes): void |
| 267 | { |
| 268 | $this->imdbVotes = $imdbVotes; |
| 269 | } |
| 270 | |
| 271 | public function setImdbId(string $imdbId): void |
| 272 | { |
| 273 | $this->imdbId = $imdbId; |
| 274 | } |
| 275 | |
| 276 | public function setType(string $type): void |
| 277 | { |
| 278 | $this->type = $type; |
| 279 | } |
| 280 | |
| 281 | public function setDvd(string $dvd): void |
| 282 | { |
| 283 | $this->dvd = $dvd; |
| 284 | } |
| 285 | |
| 286 | public function setBoxOffice(string $boxOffice): void |
| 287 | { |
| 288 | $this->boxOffice = $boxOffice; |
| 289 | } |
| 290 | |
| 291 | public function setProduction(string $production): void |
| 292 | { |
| 293 | $this->production = $production; |
| 294 | } |
| 295 | |
| 296 | public function setWebsite(string $website): void |
| 297 | { |
| 298 | $this->website = $website; |
| 299 | } |
| 300 | |
| 301 | public function setResponse(string $response): void |
| 302 | { |
| 303 | $this->response = $response; |
| 304 | } |
| 305 | } |