AnalysisResultsImportException::fromException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Domain\ResultsParser;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\SarbException;
8
9
/**
10
 * Used to for when importing a BaseLine file fails.
11
 */
12
final class AnalysisResultsImportException extends SarbException
13
{
14
    public static function fromException(Identifier $identifier, \Exception $e): self
15
    {
16
        $message = <<<EOF
17
Failed to parse analysis results. Have you supplied the data for format [{$identifier->getCode()}].
18
{$e->getMessage()}
19
EOF;
20
21
        return new self($message, 0, $e);
22
    }
23
}
24