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

UserNotificationBuilder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A whereType() 0 5 1
1
<?php
2
3
namespace Sfneal\Users\Builders;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Sfneal\Builders\QueryBuilder;
7
use Sfneal\Users\Builders\Interfaces\WhereUserInterface;
8
use Sfneal\Users\Builders\Traits\WhereUser;
9
use Sfneal\Users\Models\UserNotification;
10
11
class UserNotificationBuilder extends QueryBuilder implements WhereUserInterface
12
{
13
    use WhereUser;
14
15
    /**
16
     * @var Model|UserNotification
17
     */
18
    protected $targetModel = UserNotification::class;
19
20
    /**
21
     * Scope Query to UserNotification's of a certain 'type'.
22
     *
23
     * @param string $type
24
     * @param string $operator
25
     * @param string $boolean
26
     *
27
     * @return $this
28
     */
29
    public function whereType(string $type, string $operator = '=', string $boolean = 'and')
30
    {
31
        $this->where('type', $operator, $type, $boolean);
32
33
        return $this;
34
    }
35
}
36