Passed
Push — master ( e8502e...677200 )
by Stephen
24:48
created

NonTeamUsersQuery::builder()   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
namespace Sfneal\Users\Queries;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use Illuminate\Database\Eloquent\Collection;
7
use Sfneal\Queries\Query;
8
use Sfneal\Users\Builders\UserBuilder;
9
use Sfneal\Users\Models\User;
10
11
class NonTeamUsersQuery extends Query
12
{
13
    /**
14
     * Retrieve a Query builder.
15
     *
16
     * @return UserBuilder
17
     */
18
    protected function builder(): UserBuilder
19
    {
20
        return User::query()->withInactive();
21
    }
22
23
    /**
24
     * Retrieve a Collection of User's who are NOT team members.
25
     *
26
     * @return Collection
27
     */
28
    public function execute()
29
    {
30
        return $this->builder()
31
            ->doesntHave('team')
32
            ->orderBy('last_name', 'asc')
0 ignored issues
show
Bug introduced by
The method orderBy() does not exist on Sfneal\Users\Builders\UserBuilder. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

32
            ->/** @scrutinizer ignore-call */ orderBy('last_name', 'asc')
Loading history...
33
            ->orderBy('first_name', 'asc')
34
            ->get();
35
    }
36
}
37