Passed
Push — master ( f539f4...b6e655 )
by Alain
02:32
created

InvalidDomain   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A from() 0 4 1
1
<?php
2
/**
3
 * Bright Nucleus Chainmail Component.
4
 *
5
 * @package   BrightNucleus\ChainMail
6
 * @author    Alain Schlesser <[email protected]>
7
 * @license   MIT
8
 * @link      http://www.brightnucleus.com/
9
 * @copyright 2016 Alain Schlesser, Bright Nucleus
10
 */
11
12
namespace BrightNucleus\ChainMail\Exception;
13
14
use BrightNucleus\Exception\RuntimeException;
15
16
/**
17
 * Class InvalidDomain.
18
 *
19
 * @since   1.0.0
20
 *
21
 * @package BrightNucleus\ChainMail\Exception
22
 * @author  Alain Schlesser <[email protected]>
23
 */
24
class InvalidDomain extends RuntimeException implements ChainmailException
25
{
26
27
    /**
28
     * Create an InvalidDomain exception based on a specific domain.
29
     *
30
     * @param string $domain Email that failed validation.
31
     *
32
     * @return static
33
     */
34 1
    public static function from($domain)
35
    {
36 1
        return new static(sprintf('Invalid domain name: "%1$s".', $domain));
37
    }
38
}
39