Code Duplication    Length = 11-12 lines in 10 locations

src/VfacTmdb/Items/Collection.php 2 locations

@@ 105-115 (lines=11) @@
102
     * Get collection backdrops
103
     * @return \Generator|Results\Image
104
     */
105
    public function getBackdrops() : \Generator
106
    {
107
        $params = [];
108
        $this->tmdb->checkOptionLanguage($this->params, $params);
109
        $data = $this->tmdb->getRequest('collection/' . (int) $this->id . '/images', $params);
110
111
        foreach ($data->backdrops as $b) {
112
            $image = new Results\Image($this->tmdb, $this->id, $b);
113
            yield $image;
114
        }
115
    }
116
117
    /**
118
     * Get collection posters
@@ 121-131 (lines=11) @@
118
     * Get collection posters
119
     * @return \Generator|Results\Image
120
     */
121
    public function getPosters() : \Generator
122
    {
123
        $params = [];
124
        $this->tmdb->checkOptionLanguage($this->params, $params);
125
        $data = $this->tmdb->getRequest('collection/' . (int) $this->id . '/images', $params);
126
127
        foreach ($data->posters as $b) {
128
            $image = new Results\Image($this->tmdb, $this->id, $b);
129
            yield $image;
130
        }
131
    }
132
}
133

src/VfacTmdb/Items/Company.php 1 location

@@ 122-132 (lines=11) @@
119
     * Company movies list
120
     * @return \Generator|Results\Movie
121
     */
122
    public function getMovies() : \Generator
123
    {
124
        $params = [];
125
        $this->tmdb->checkOptionLanguage($this->params, $params);
126
        $data = $this->tmdb->getRequest('company/' . (int) $this->id . '/movies', $params);
127
128
        foreach ($data->results as $m) {
129
            $movie = new Results\Movie($this->tmdb, $m);
130
            yield $movie;
131
        }
132
    }
133
}
134

src/VfacTmdb/Items/TVShow.php 3 locations

@@ 198-208 (lines=11) @@
195
     * Backdrops list
196
     * @return \Generator|Results\Image
197
     */
198
    public function getBackdrops() : \Generator
199
    {
200
        $params = [];
201
        $this->tmdb->checkOptionLanguage($this->params, $params);
202
        $data = $this->tmdb->getRequest('tv/' . (int) $this->id . '/images', $params);
203
204
        foreach ($data->backdrops as $b) {
205
            $image = new Results\Image($this->tmdb, $this->id, $b);
206
            yield $image;
207
        }
208
    }
209
210
    /**
211
     * Posters list
@@ 214-224 (lines=11) @@
211
     * Posters list
212
     * @return \Generator|Results\Image
213
     */
214
    public function getPosters() : \Generator
215
    {
216
        $params = [];
217
        $this->tmdb->checkOptionLanguage($this->params, $params);
218
        $data = $this->tmdb->getRequest('tv/' . (int) $this->id . '/images', $params);
219
220
        foreach ($data->posters as $b) {
221
            $image = new Results\Image($this->tmdb, $this->id, $b);
222
            yield $image;
223
        }
224
    }
225
226
    /**
227
     * Get Similar TVShow
@@ 230-241 (lines=12) @@
227
     * Get Similar TVShow
228
     * @return \Generator|Results\TVShow
229
     */
230
    public function getSimilar() : \Generator
231
    {
232
        $params = [];
233
        $this->tmdb->checkOptionLanguage($this->params, $params);
234
        $this->tmdb->checkOptionPage($this->params, $params);
235
        $similar = $this->tmdb->getRequest('tv/' . (int) $this->id . '/similar', $params);
236
237
        foreach ($similar->results as $t) {
238
            $tvshow = new Results\TVShow($this->tmdb, $t);
239
            yield $tvshow;
240
        }
241
    }
242
}
243

src/VfacTmdb/Items/People.php 1 location

@@ 209-219 (lines=11) @@
206
     * Images Profiles
207
     * @return \Generator|Results\Image
208
     */
209
    public function getProfiles() : \Generator
210
    {
211
        $params = [];
212
        $this->tmdb->checkOptionLanguage($this->params, $params);
213
        $data = $this->tmdb->getRequest('person/' . (int) $this->id . '/images', $params);
214
215
        foreach ($data->profiles as $b) {
216
            $image = new Results\Image($this->tmdb, $this->id, $b);
217
            yield $image;
218
        }
219
    }
220
221
    /**
222
     * Get movies cast

src/VfacTmdb/Items/Movie.php 3 locations

@@ 235-245 (lines=11) @@
232
     * Get image backdrops list
233
     * @return \Generator|Results\Image
234
     */
235
    public function getBackdrops() : \Generator
236
    {
237
        $params = [];
238
        $this->tmdb->checkOptionLanguage($this->params, $params);
239
        $data = $this->tmdb->getRequest('movie/' . (int) $this->id . '/images', $params);
240
241
        foreach ($data->backdrops as $b) {
242
            $image = new Results\Image($this->tmdb, $this->id, $b);
243
            yield $image;
244
        }
245
    }
246
247
    /**
248
     * Get image posters list
@@ 251-261 (lines=11) @@
248
     * Get image posters list
249
     * @return \Generator|Results\Image
250
     */
251
    public function getPosters() : \Generator
252
    {
253
        $params = [];
254
        $this->tmdb->checkOptionLanguage($this->params, $params);
255
        $data = $this->tmdb->getRequest('movie/' . (int) $this->id . '/images', $params);
256
257
        foreach ($data->posters as $b) {
258
            $image = new Results\Image($this->tmdb, $this->id, $b);
259
            yield $image;
260
        }
261
    }
262
263
    /**
264
     * Get similar movies from current movie
@@ 267-278 (lines=12) @@
264
     * Get similar movies from current movie
265
     * @return \Generator|Results\Movie
266
     */
267
    public function getSimilar() : \Generator
268
    {
269
        $params = [];
270
        $this->tmdb->checkOptionLanguage($this->params, $params);
271
        $this->tmdb->checkOptionPage($this->params, $params);
272
        $data = $this->tmdb->getRequest('movie/' . (int) $this->id . '/similar', $params);
273
274
        foreach ($data->results as $s) {
275
            $movie = new Results\Movie($this->tmdb, $s);
276
            yield $movie;
277
        }
278
    }
279
}
280