DiscussCategoryRepository::sidebar()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
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