BaseFileProcessor::getTools()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
  namespace Funivan\Cs\FileProcessor;
4
5
  use Funivan\Cs\FileTool\FileTool;
6
  use Symfony\Component\Console\Output\NullOutput;
7
  use Symfony\Component\Console\Output\OutputInterface;
8
9
  /**
10
   * @author Ivan Shcherbak <[email protected]> 2016
11
   */
12
  abstract class BaseFileProcessor implements FileProcessorInterface {
13
14
    /**
15
     * @var FileTool[]
16
     */
17
    private $tools = [];
18
19
    /**
20
     * @var OutputInterface
21
     */
22
    private $output;
23
24
25
    /**
26
     * @param FileTool $tool
27
     */
28
    public function addTool(FileTool $tool) {
29
      $this->tools[] = $tool;
30
    }
31
32
33
    /**
34
     * @return FileTool[]
35
     */
36
    public function getTools() {
37
      return $this->tools;
38
    }
39
40
41
    /**
42
     * Sets a logger.
43
     *
44
     * @param OutputInterface $logger
45
     */
46
    public function setOutput(OutputInterface $logger) {
47
      $this->output = $logger;
48
    }
49
50
51
    /**
52
     * @return OutputInterface
53
     */
54
    public function getOutput() {
55
      if (null === $this->output) {
56
        $this->output = new NullOutput();
57
      }
58
59
      return $this->output;
60
    }
61
62
  }