CommitMsgProcessor::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
ccs 5
cts 5
cp 1
cc 2
nc 2
nop 2
crap 2
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Service;
4
5
use Composer\IO\IOInterface;
6
use PhpGitHooks\Module\Configuration\Domain\CommitMsg;
7
8
class CommitMsgProcessor
9
{
10
    /**
11
     * @var IOInterface
12
     */
13
    private $io;
14
15
    /**
16
     * @param CommitMsg   $commitMsgData
17
     * @param IOInterface $io
18
     *
19
     * @return CommitMsg
20
     */
21 3
    public function process(CommitMsg $commitMsgData, IOInterface $io)
22
    {
23 3
        $this->io = $io;
24
25 3
        if (true === $commitMsgData->isUndefined()) {
26 2
            $commitMsgData = CommitMsgConfigurator::configure($this->io, $commitMsgData);
27
        }
28
29 3
        return $commitMsgData;
30
    }
31
}
32