Passed
Push — master ( 666edc...4ba5ff )
by Stephen
06:52
created

WherePublicStatus::wherePublic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 2
b 1
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Sfneal\Builders\Traits;
4
5
trait WherePublicStatus
6
{
7
    /**
8
     * Scope query results to only results that are public.
9
     *
10
     * @param int $value
11
     * @return $this
12
     */
13
    public function wherePublic($value = 1)
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

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

13
    public function wherePublic(/** @scrutinizer ignore-unused */ $value = 1)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    {
15
        $this->where('public_status', '=', 1);
0 ignored issues
show
Bug introduced by
The method where() does not exist on Sfneal\Builders\Traits\WherePublicStatus. Did you maybe mean wherePublic()? ( Ignorable by Annotation )

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

15
        $this->/** @scrutinizer ignore-call */ 
16
               where('public_status', '=', 1);

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...
16
17
        return $this;
18
    }
19
20
    /**
21
     * Scope query results to only results that are private.
22
     *
23
     * @return $this
24
     */
25
    public function wherePrivate()
26
    {
27
        $this->wherePublic(0);
28
29
        return $this;
30
    }
31
}
32