Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
56 | 2 | public function getPosters() : \Generator |
|
57 | { |
||
58 | 2 | $params = $this->getPostersParams(); |
|
59 | 2 | $key = $params->key; |
|
60 | 2 | $data = $this->tmdb->getRequest($params->url, $this->params); |
|
61 | |||
62 | 2 | foreach ($data->$key as $b) { |
|
63 | 2 | $image = new Results\Image($this->tmdb, $this->id, $b); |
|
64 | 2 | yield $image; |
|
65 | } |
||
66 | 2 | } |
|
67 | } |
||
68 |
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: