Completed
Push — master ( 72d72a...bb8091 )
by Yaro
06:09
created

Filter::filter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
ccs 6
cts 6
cp 1
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Traits;
4
5
use Yaro\Jarboe\Table\Filters\AbstractFilter;
6
7
trait Filter
8
{
9
    protected $filter = null;
10
11 45
    public function filter(AbstractFilter $filter = null)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
12
    {
13 45
        if (is_null($filter)) {
14 45
            return $this->filter;
15
        }
16
17 16
        $filter->field($this);
18
19 16
        $this->filter = $filter;
20
21 16
        return $this;
22
    }
23
}
24