Code Duplication    Length = 10-11 lines in 2 locations

app/Repository/Project/ProjectRepository.php 1 location

@@ 254-263 (lines=10) @@
251
     *
252
     * @return Collection
253
     */
254
    public function getProjectsWithOpenIssuesCount($status = Project::STATUS_OPEN, $private = Project::PRIVATE_YES)
255
    {
256
        $query = $this->model->with('countOpenIssues')->status($status);
257
258
        if ($private !== Project::PRIVATE_ALL) {
259
            $query->where('private', '=', $private);
260
        }
261
262
        return $query->get();
263
    }
264
265
    /**
266
     * Return projects with count of open & closed issues.

app/Repository/Traits/Project/CountTrait.php 1 location

@@ 173-183 (lines=11) @@
170
     *
171
     * @return mixed
172
     */
173
    public function projectsWithOpenIssuesCount($status = Project::STATUS_OPEN, $private = Project::PRIVATE_YES)
174
    {
175
        $query = $this->with('openIssuesCount')
176
            ->where('status', '=', $status);
177
178
        if ($private !== Project::PRIVATE_ALL) {
179
            $query->where('private', '=', $private);
180
        }
181
182
        return $query;
183
    }
184
185
    abstract public function hasOne($related, $foreignKey = null, $localKey = null);
186
    abstract public function isPrivateInternal();