PublicStatusFilter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 6 1
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