Passed
Push — 5.0.0 ( c86c37...f3ec4d )
by Fèvre
06:46
created

BlogCategoryRepository::sidebar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Models\Repositories;
6
7
use Illuminate\Support\Collection;
8
use Xetaravel\Models\BlogCategory;
9
10
class BlogCategoryRepository
11
{
12
    /**
13
     * Find the categories for the sidebar.
14
     *
15
     * @return Collection
16
     */
17
    public static function sidebar(): Collection
18
    {
19
        return BlogCategory::take(config('xetaravel.blog.categories_sidebar'))->orderBy('title', 'asc')->get();
0 ignored issues
show
Bug introduced by
'title' 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 BlogCategory::take(config('xetaravel.blog.categories_sidebar'))->orderBy(/** @scrutinizer ignore-type */ 'title', 'asc')->get();
Loading history...
20
    }
21
}
22