AbstractProcessor::getIO()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Habu\ComposerScriptUtils\Processor;
4
5
use Composer\Composer;
6
use Composer\IO\IOInterface;
7
use Composer\Script\Event;
8
use Habu\ComposerScriptUtils\Interfaces\ConfigurationInterface;
9
use Habu\ComposerScriptUtils\Interfaces\ProcessorInterface;
10
11
/**
12
 * Class AbstractProcessor.
13
 *
14
 * @author Ruben Knol <[email protected]>
15
 */
16
abstract class AbstractProcessor implements ProcessorInterface
17
{
18
    /**
19
     * @var IOInterface
20
     */
21
    private $io;
22
23
    /**
24
     * @var Composer
25
     */
26
    private $composer;
27
28
29 3
    public function __construct(IOInterface $io, Composer $composer)
30
    {
31 3
        $this->io = $io;
32 3
        $this->composer = $composer;
33 3
    }
34
35
    /**
36
     * @return IOInterface
37
     */
38 1
    protected function getIO()
39
    {
40 1
        return $this->io;
41
    }
42
43
    /**
44
     * @return Composer
45
     */
46 1
    protected function getComposer()
47
    {
48 1
        return $this->composer;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    abstract public function process(ConfigurationInterface $configuration, Event $event);
55
}
56