Code Duplication    Length = 7-7 lines in 2 locations

components/EpisodeComponent.php 1 location

@@ 146-152 (lines=7) @@
143
        $this->episode = $this->loadEpisode();
144
145
        $this->releases = Collection::make($this->episode->releases); // Creates a copy
146
        $this->releases->sort(function (Release $a, Release $b) {
147
            // Order by the sort_order column
148
            $aRating = $a->release_type->sort_order;
149
            $bRating = $b->release_type->sort_order;
150
151
            return $aRating - $bRating;
152
        });
153
    }
154
155
    /**

components/LatestEpisodeComponent.php 1 location

@@ 96-102 (lines=7) @@
93
94
95
        $this->releases = Collection::make($this->episode->releases); // Creates a copy
96
        $this->releases->sort(function (Release $a, Release $b) {
97
            // Order by the sort_order column
98
            $aRating = $a->release_type->sort_order;
99
            $bRating = $b->release_type->sort_order;
100
101
            return $aRating - $bRating;
102
        });
103
    }
104
}