GuzzleHttpServiceCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 2
A getChecks() 0 4 1
1
<?php
2
3
namespace Liip\MonitorBundle\Check;
4
5
use Laminas\Diagnostics\Check\CheckCollectionInterface;
6
use Laminas\Diagnostics\Check\GuzzleHttpService;
7
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
class GuzzleHttpServiceCollection implements CheckCollectionInterface
12
{
13
    private $checks = [];
14
15 1
    public function __construct(array $configs)
16
    {
17 1
        foreach ($configs as $name => $config) {
18 1
            $check = new GuzzleHttpService(
19 1
                $config['url'],
20 1
                $config['headers'],
21 1
                $config['options'],
22 1
                $config['status_code'],
23 1
                $config['content'],
24 1
                null,
25 1
                $config['method'],
26 1
                $config['body']
27
            );
28 1
            $check->setLabel(sprintf('Guzzle Http Service "%s"', $name));
29
30 1
            $this->checks[sprintf('guzzle_http_service_%s', $name)] = $check;
31
        }
32 1
    }
33
34 1
    public function getChecks()
35
    {
36 1
        return $this->checks;
37
    }
38
}
39