PublicStatusFilter::apply()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 2 Features 0
Metric Value
cc 1
eloc 2
c 2
b 2
f 0
nc 1
nop 2
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Sfneal\Filters;
4
5
use Illuminate\Database\Eloquent\Builder;
6
7
class PublicStatusFilter implements FilterInterface
8
{
9
    protected const COLUMN = 'public_status';
10
11
    /**
12
     * Apply a public_status filter to a Query.
13
     *
14
     * @param Builder $query
15
     * @param mixed $value
16
     * @return Builder
17
     */
18
    public static function apply($query, $value)
19
    {
20
        // todo: improve this with WherePublic interface
21
        $query->wherePublic($value);
22
23
        return $query;
24
    }
25
}
26