AnalysisResultsImportException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromException() 0 8 1
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