Completed
Push — master ( 187043...48cde4 )
by
unknown
01:30
created

SortsField::__invoke()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 1
nop 3
1
<?php
2
3
namespace Spatie\QueryBuilder\Sorts;
4
5
use Illuminate\Database\Eloquent\Builder;
6
7
class SortsField implements Sort
8
{
9
    public function __invoke(Builder $query, bool $descending, string $property)
10
    {
11
        $query->orderBy($property, $descending ? 'desc' : 'asc');
0 ignored issues
show
Bug introduced by
The method orderBy() does not exist on Illuminate\Database\Eloquent\Builder. Did you maybe mean enforceOrderBy()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
12
    }
13
}
14