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

WhereUser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A whereUser() 0 5 1
A whereUserIn() 0 5 1
1
<?php
2
3
namespace Sfneal\Users\Builders\Traits;
4
5
use Sfneal\Users\Builders\Interfaces\WhereUserInterface;
6
7
trait WhereUser
8
{
9
    /**
10
     * Scope query to activity that was performed by a particular user.
11
     *
12
     * @param int $user_id
13
     *
14
     * @return $this|WhereUserInterface
15
     */
16
    public function whereUser(int $user_id)
17
    {
18
        $this->where('user_id', '=', $user_id);
0 ignored issues
show
Bug introduced by
The method where() does not exist on Sfneal\Users\Builders\Traits\WhereUser. Did you maybe mean whereUser()? ( Ignorable by Annotation )

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

18
        $this->/** @scrutinizer ignore-call */ 
19
               where('user_id', '=', $user_id);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
20
        return $this;
21
    }
22
23
    /**
24
     * Scope query to activity that was performed by any of the specified users.
25
     *
26
     * @param array $user_ids
27
     *
28
     * @return $this|WhereUserInterface
29
     */
30
    public function whereUserIn(array $user_ids)
31
    {
32
        $this->whereIn('user_id', $user_ids);
0 ignored issues
show
Bug introduced by
The method whereIn() does not exist on Sfneal\Users\Builders\Traits\WhereUser. Did you maybe mean whereUserIn()? ( Ignorable by Annotation )

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

32
        $this->/** @scrutinizer ignore-call */ 
33
               whereIn('user_id', $user_ids);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33
34
        return $this;
35
    }
36
}
37