Passed
Push — master ( b5e6ba...9ab7d8 )
by Radu
09:39 queued 02:23
created

AbstractCliRunnerProcessor   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 1
b 0
f 0
dl 0
loc 31
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Processors;
6
7
use WebServCo\Framework\Interfaces\CliRunnerInterface;
8
use WebServCo\Framework\Interfaces\ErrorProcessorInterface;
9
use WebServCo\Framework\Interfaces\LoggerInterface;
10
use WebServCo\Framework\Interfaces\OutputLoggerInterface;
11
12
abstract class AbstractCliRunnerProcessor implements \WebServCo\Framework\Interfaces\RunnerInterface
13
{
14
    // Log simple messages to both file and output.
15
    use \WebServCo\Framework\Traits\LogTrait;
16
17
    protected CliRunnerInterface $cliRunner;
18
19
    protected ErrorProcessorInterface $errorProcessor;
20
21
    protected LoggerInterface $fileLogger;
22
23
    protected OutputLoggerInterface $outputLogger;
24
25
    /**
26
    * Called by the "run" method.
27
    */
28
    abstract protected function finish(bool $result): bool;
29
30
    public function __construct(
31
        CliRunnerInterface $cliRunner,
32
        ErrorProcessorInterface $errorProcessor,
33
        LoggerInterface $fileLogger,
34
        OutputLoggerInterface $outputLogger
35
    ) {
36
        $this->cliRunner = $cliRunner;
37
38
        $this->errorProcessor = $errorProcessor;
39
40
        $this->fileLogger = $fileLogger;
41
42
        $this->outputLogger = $outputLogger;
43
    }
44
}
45