DomainValidationException   A
last analyzed

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
class DomainValidationException extends LetsEncryptClientException
6
{
7
    public static function localHttpChallengeTestFailed(string $domain, string $code): self
8
    {
9
        return new static(sprintf(
10
            'The local HTTP challenge test for %s received an invalid response with a %s status code.',
11
            $domain,
12
            $code
13
        ));
14
    }
15
16
    public static function localDnsChallengeTestFailed(string $domain): self
17
    {
18
        return new static(sprintf(
19
            "Couldn't fetch the correct DNS records for %s.",
20
            $domain
21
        ));
22
    }
23
}
24