DiscussCategoryRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A sidebar() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Models\Repositories;
6
7
use Illuminate\Support\Collection;
8
use Xetaravel\Models\DiscussCategory;
9
10
class DiscussCategoryRepository
11
{
12
    /**
13
     * Find the categories for the sidebar.
14
     *
15
     * @return Collection
16
     */
17
    public static function sidebar(): Collection
18
    {
19
        return DiscussCategory::take(config('xetaravel.discuss.categories_sidebar'))->orderBy('level', 'asc')->get();
0 ignored issues
show
Bug introduced by
'level' of type string is incompatible with the type Closure|Illuminate\Datab...\Database\Query\Builder expected by parameter $column of Illuminate\Database\Query\Builder::orderBy(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
        return DiscussCategory::take(config('xetaravel.discuss.categories_sidebar'))->orderBy(/** @scrutinizer ignore-type */ 'level', 'asc')->get();
Loading history...
20
    }
21
}
22