LoggerChain   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 26
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addLogger() 0 4 1
A startQuery() 0 6 2
A stopQuery() 0 6 2
1
<?php
2
3
namespace Brouzie\Sphinxy\Logging;
4
5
class LoggerChain implements LoggerInterface
6
{
7
    /**
8
     * @var LoggerInterface[]
9
     */
10
    private $loggers;
11
12
    public function addLogger(LoggerInterface $logger)
13
    {
14
        $this->loggers[] = $logger;
15
    }
16
17
    public function startQuery($sql, array $params = null)
18
    {
19
        foreach ($this->loggers as $logger) {
20
            $logger->startQuery($sql, $params);
21
        }
22
    }
23
24
    public function stopQuery()
25
    {
26
        foreach ($this->loggers as $logger) {
27
            $logger->stopQuery();
28
        }
29
    }
30
}
31