NewFile   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 2
A isValid() 0 3 2
1
<?php
2
namespace exussum12\CoverageChecker\DiffLineHandle\OldVersion;
3
4
use exussum12\CoverageChecker\DiffLineHandle;
5
6
class NewFile extends DiffLineHandle
7
{
8
9
    public function handle(string $line)
10
    {
11
        if (preg_match('#--- a?/(?<filename>.*)#', $line, $match)) {
12
            $this->diffFileState->setCurrentFile($match['filename']);
13
        }
14
    }
15
16
    public function isValid(string $line): bool
17
    {
18
        return $line[0] == '-' && $line[1] == '-';
19
    }
20
}
21