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

InvalidDomain::from()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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