Completed
Push — master ( ec3cb6...40821e )
by Lukas Kahwe
9s
created

MemcachedCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A getChecks() 0 4 1
1
<?php
2
3
namespace Liip\MonitorBundle\Check;
4
5
use ZendDiagnostics\Check\CheckCollectionInterface;
6
use ZendDiagnostics\Check\Memcached;
7
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
class MemcachedCollection implements CheckCollectionInterface
12
{
13
    private $checks = array();
14
15
    public function __construct(array $configs)
16
    {
17
        foreach ($configs as $name => $config) {
18
            $check = new Memcached($config['host'], $config['port']);
19
            $check->setLabel(sprintf('Memcached "%s"', $name));
20
21
            $this->checks[sprintf('memcached_%s', $name)] = $check;
22
        }
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function getChecks()
29
    {
30
        return $this->checks;
31
    }
32
}
33