Code Duplication    Length = 9-10 lines in 4 locations

src/VfacTmdb/Abstracts/Items/PeopleItemCredit.php 2 locations

@@ 63-72 (lines=10) @@
60
     * Crew
61
     * @return \Generator
62
     */
63
    public function getCrew() : \Generator
64
    {
65
        if (!empty($this->data->crew)) {
66
            foreach ($this->data->crew as $c) {
67
                $crew_class = $this->crew_class;
68
                $crew = new $crew_class($this->tmdb, $c);
69
                yield $crew;
70
            }
71
        }
72
    }
73
74
    /**
75
     * Cast
@@ 78-87 (lines=10) @@
75
     * Cast
76
     * @return \Generator
77
     */
78
    public function getCast() : \Generator
79
    {
80
        if (!empty($this->data->cast)) {
81
            foreach ($this->data->cast as $c) {
82
                $cast_class = $this->cast_class;
83
                $cast = new $cast_class($this->tmdb, $c);
84
                yield $cast;
85
            }
86
        }
87
    }
88
}
89

src/VfacTmdb/Items/MovieCredit.php 2 locations

@@ 72-80 (lines=9) @@
69
     * Crew
70
     * @return \Generator|Results\Crew
71
     */
72
    public function getCrew() : \Generator
73
    {
74
        if (!empty($this->data->crew)) {
75
            foreach ($this->data->crew as $c) {
76
                $crew = new Results\Crew($this->tmdb, $c);
77
                yield $crew;
78
            }
79
        }
80
    }
81
82
    /**
83
     * Cast
@@ 86-94 (lines=9) @@
83
     * Cast
84
     * @return \Generator|Results\Cast
85
     */
86
    public function getCast() : \Generator
87
    {
88
        if (!empty($this->data->cast)) {
89
            foreach ($this->data->cast as $c) {
90
                $cast = new Results\Cast($this->tmdb, $c);
91
                yield $cast;
92
            }
93
        }
94
    }
95
}
96