Passed
Push — master ( 4c8245...5bb496 )
by Scott
02:18
created

NewFile::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace exussum12\CoverageChecker\DiffLineHandle\NewVersion;
3
4
use exussum12\CoverageChecker\DiffLineHandle;
5
6 View Code Duplication
class NewFile extends DiffLineHandle
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
7
{
8
9
    public function handle($line)
10
    {
11
        $parsedLine = sscanf($line, '+++ %1s/%s');
12
        $currentFileName = $parsedLine[1];
13
        if ($currentFileName) {
14
            $this->diffFileState->setCurrentFile($currentFileName);
15
        }
16
    }
17
18
    public function isValid($line)
19
    {
20
        return $line[0] == '+' && $line[1] == '+';
21
    }
22
}
23