Passed
Push — main ( f4e9d2...4a4379 )
by Jesse
01:41
created

InvalidFormat::couldNotLoad()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 9
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\PuzzleSolver;
4
5
use RuntimeException;
6
use function sprintf;
7
use const PHP_EOL;
8
9
final class InvalidFormat extends RuntimeException implements PuzzleCreationFailure
10
{
11
    public static function couldNotLoad(string $puzzleType, string $input, string $error = ''): self
12
    {
13
        return new self(sprintf(
14
            'Invalid format. Could not load the %s from input:%s%s%s%s',
15
            $puzzleType,
16
            PHP_EOL,
17
            $input,
18
            PHP_EOL,
19
            $error
20
        ));
21
    }
22
}
23