PropertyFilterTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropertyFilter() 0 8 2
A setPropertyFilter() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Crossjoin\Browscap\PropertyFilter;
5
6
/**
7
 * Trait PropertyFilterTrait
8
 *
9
 * @package Crossjoin\Browscap\PropertyFilter
10
 * @author Christoph Ziegenberg <[email protected]>
11
 * @link https://github.com/crossjoin/browscap
12
 */
13
trait PropertyFilterTrait
14
{
15
    /**
16
     * @var PropertyFilterInterface
17
     */
18
    protected $propertyFilter;
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function getPropertyFilter() : PropertyFilterInterface
24
    {
25
        if ($this->propertyFilter === null) {
26
            $this->propertyFilter = new None();
27
        }
28
29
        return $this->propertyFilter;
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    public function setPropertyFilter(PropertyFilterInterface $filter)
36
    {
37
        $this->propertyFilter = $filter;
38
    }
39
}
40