Completed
Push — master ( ad7ee3...c08a34 )
by Rogier
29s queued 12s
created

DomainValidationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A localHttpChallengeTestFailed() 0 6 1
A localDnsChallengeTestFailed() 0 5 1
1
<?php
2
3
namespace Rogierw\RwAcme\Exceptions;
4
5
use Exception;
6
7
class DomainValidationException extends Exception
8
{
9
    public static function localHttpChallengeTestFailed(string $domain, string $code): self
10
    {
11
        return new static(sprintf(
12
            'The local HTTP challenge test for %s received an invalid response with a %s status code.',
13
            $domain,
14
            $code
15
        ));
16
    }
17
18
    public static function localDnsChallengeTestFailed(string $domain): self
19
    {
20
        return new static(sprintf(
21
            "Couldn't fetch DNS records for %s.",
22
            $domain
23
        ));
24
    }
25
}
26