StorageFailure   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A failedToLoad() 0 6 1
A failedToSave() 0 6 1
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