FlushListener   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 25
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addFlusher() 0 4 1
A onFlush() 0 6 2
1
<?php
2
3
namespace TreeHouse\QueueBundle\EventListener;
4
5
use TreeHouse\QueueBundle\Flusher\FlushingInterface;
6
7
class FlushListener
8
{
9
    /**
10
     * @var FlushingInterface[]
11
     */
12
    protected $flushers = [];
13
14
    /**
15
     * @param FlushingInterface $flusher
16
     */
17 1
    public function addFlusher(FlushingInterface $flusher)
18
    {
19 1
        $this->flushers[] = $flusher;
20 1
    }
21
22
    /**
23
     * Calls all flushers
24
     */
25 1
    public function onFlush()
26
    {
27 1
        foreach ($this->flushers as $flusher) {
28 1
            $flusher->flush();
29
        }
30 1
    }
31
}
32