CombinedStringFilter   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
lcom 1
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addFilter() 0 4 1
A filter() 0 8 2
1
<?php
2
3
namespace CultuurNet\UDB3\StringFilter;
4
5
class CombinedStringFilter implements StringFilterInterface
6
{
7
    /**
8
     * @var StringFilterInterface[]
9
     */
10
    protected $filters = array();
11
12
    /**
13
     * @param StringFilterInterface $filter
14
     */
15
    public function addFilter($filter)
16
    {
17
        $this->filters[] = $filter;
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function filter($string)
24
    {
25
        foreach ($this->filters as $filter) {
26
            $string = $filter->filter($string);
27
        }
28
29
        return $string;
30
    }
31
}
32