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

BlogCategoryRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
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\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