StorageFailure::failedToSave()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace NiR\CircuitBreaker\Exception;
6
7
final class StorageFailure extends \RuntimeException
8
{
9
    public static function failedToLoad(string $storage, string $serviceName): self
10
    {
11
        return new self(sprintf(
12
            'Circuit breaker storage (%s) failed to fetch status of "%s".',
13
            $storage,
14
            $serviceName
15
        ));
16
    }
17
18
    public static function failedToSave(string $storage, string $serviceName): self
19
    {
20
        return new self(sprintf(
21
            'Circuit breaker storage (%s) failed to save status of "%s".',
22
            $storage,
23
            $serviceName
24
        ));
25
    }
26
}
27