HealthContributorRegistryBuilder::build()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nwidart\Actuator\Health;
6
7
class HealthContributorRegistryBuilder
8
{
9 7
    public function build(): HealthContributorRegistry
10
    {
11 7
        $registry = new HealthContributorRegistry();
12 7
        $contributors = config('actuator.health.contributors');
13 7
        foreach ($contributors as $name => $contributor) {
14 5
            $registry->register($name, app($contributor));
15
        }
16
17 7
        return $registry;
18
    }
19
}
20