Completed
Push — master ( 3b3aeb...14bab3 )
by
unknown
01:16
created

Future   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A addFuture() 0 7 2
1
<?php
2
3
namespace AfriCC\EPP\Extension\NASK\Check;
4
5
use AfriCC\EPP\Frame\Command\Check as CheckCommand;
6
use AfriCC\EPP\Validator;
7
use Exception;
8
9
class Future extends CheckCommand
10
{
11
    /**
12
     * Add future (option for domain)
13
     *
14
     * @param string $domain Domain name
15
     *
16
     * @throws Exception Upon incorrect domain name
17
     */
18
    public function addFuture($domain)
19
    {
20
        if (!Validator::isHostname($domain)) {
21
            throw new Exception(sprintf('%s is not a valid domain name', $domain));
22
        }
23
        $this->set('future:name[]', $domain);
24
    }
25
}
26