TypoScriptLintError::fromIssue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Pluswerk\TypoScriptLinter;
5
6
use GrumPHP\Linter\LintError;
7
use Helmich\TypoScriptLint\Linter\Report\File;
8
use Helmich\TypoScriptLint\Linter\Report\Issue;
9
use Helmich\TypoScriptParser\Parser\ParseError;
10
11
final class TypoScriptLintError extends LintError
12
{
13 8
    public static function fromIssue(Issue $issue, string $filePathName): self
14
    {
15 8
        return new self(
16 8
            $issue->getSeverity(),
17 8
            $issue->getMessage(),
18 8
            $filePathName,
19 8
            $issue->getLine() ?? -1
20
        );
21
    }
22
}
23