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

AbstractCliRunnerProcessor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 13
rs 10
cc 1
nc 1
nop 4
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