Challenge   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isDns() 0 3 1
A isHttp() 0 3 1
A getToken() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the LetsEncrypt ACME client.
7
 *
8
 * @author    Ivanov Aleksandr <[email protected]>
9
 * @copyright 2019-2020
10
 * @license   https://github.com/misantron/letsencrypt-client/blob/master/LICENSE MIT License
11
 */
12
13
namespace LetsEncrypt\Entity;
14
15
final class Challenge extends Entity
16
{
17
    use UrlAwareTrait;
18
19
    private const TYPE_HTTP = 'http-01';
20
    private const TYPE_DNS = 'dns-01';
21
22
    /**
23
     * @var string
24
     */
25
    protected $type;
26
27
    /**
28
     * @var string
29
     */
30
    public $validated;
31
32
    /**
33
     * @var string
34
     */
35
    protected $token;
36
37
    public function isDns(): bool
38
    {
39
        return $this->type === self::TYPE_DNS;
40
    }
41
42
    public function isHttp(): bool
43
    {
44
        return $this->type === self::TYPE_HTTP;
45
    }
46
47
    public function getToken(): string
48
    {
49
        return $this->token;
50
    }
51
}
52