AbstractProcessor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getIO() 0 4 1
A getComposer() 0 4 1
process() 0 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