Passed
Push — master ( c734d9...025b20 )
by Mike
03:31
created

ExceptionRegistrar::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Xervice\ExceptionHandler\Business\Model\Register;
5
6
7
class ExceptionRegistrar implements ExceptionRegistrarInterface
8
{
9
    /**
10
     * @var \Xervice\ExceptionHandler\Business\Model\Register\RegisterCollection
11
     */
12
    private $register;
13
14
    /**
15
     * @var bool
16
     */
17
    private $isDebug;
18
19
    /**
20
     * ExceptionRegistrar constructor.
21
     *
22
     * @param \Xervice\ExceptionHandler\Business\Model\Register\RegisterCollection $register
23
     * @param bool $isDebug
24
     */
25 1
    public function __construct(RegisterCollection $register, bool $isDebug)
26
    {
27 1
        $this->register = $register;
28 1
        $this->isDebug = $isDebug;
29 1
    }
30
31 1
    public function register(): void
32
    {
33 1
        foreach ($this->register as $register) {
34 1
            $register->register($this->isDebug);
35
        }
36
    }
37
}