AbstractProcessingHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 2
A __construct() 0 4 1
1
<?php
2
/**
3
 * This file is part of the error-handling package.
4
 *
5
 * Copyright (c) Dusan Vejin
6
 *
7
 * For full copyright and license information, please refer to the LICENSE file,
8
 * located at the package root folder.
9
 */
10
11
declare(strict_types=1);
12
13
namespace WeCodeIn\ErrorHandling\Handler;
14
15
use Throwable;
16
use WeCodeIn\ErrorHandling\Processor\ProcessorInterface;
17
18
abstract class AbstractProcessingHandler extends AbstractHandler
19
{
20
    private $processors;
21
22 30
    public function __construct(ProcessorInterface ...$processors)
23
    {
24 30
        $this->processors = $processors;
25 30
    }
26
27 4
    final protected function process(Throwable $throwable) : Throwable
28
    {
29 4
        foreach ($this->processors as $processor) {
30 4
            $throwable = $processor($throwable);
31
        }
32
33 4
        return $throwable;
34
    }
35
}
36