Passed
Push — master ( 4a474d...df1b75 )
by Stephen
02:14
created

NonTeamUsersQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 7
c 1
b 1
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 1
1
<?php
2
3
namespace Sfneal\Users\Queries;
4
5
use Sfneal\Users\Models\User;
6
use Illuminate\Database\Eloquent\Collection;
7
use Sfneal\Queries\AbstractQuery;
8
9
class NonTeamUsersQuery extends AbstractQuery
10
{
11
    /**
12
     * Retrieve a Collection of User's who are NOT team members.
13
     *
14
     * @return Collection
15
     */
16
    public function execute()
17
    {
18
        return User::query()
19
            ->withInactive()
20
            ->doesntHave('team')
21
            ->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

21
            ->/** @scrutinizer ignore-call */ orderBy('last_name', 'asc')
Loading history...
22
            ->orderBy('first_name', 'asc')
23
            ->get();
24
    }
25
}
26