Code Duplication    Length = 10-11 lines in 2 locations

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();

app/Repository/Project/Fetcher.php 1 location

@@ 272-281 (lines=10) @@
269
     *
270
     * @return Collection
271
     */
272
    public function getProjectsWithOpenIssuesCount($status = Project::STATUS_OPEN, $private = Project::PRIVATE_YES)
273
    {
274
        $query = $this->model->with('openIssuesCount')->status($status);
275
276
        if ($private !== Project::PRIVATE_ALL) {
277
            $query->where('private', '=', $private);
278
        }
279
280
        return $query->get();
281
    }
282
283
    /**
284
     * Return projects with count of open & closed issues.