Passed
Push — master ( 4633d8...be0c82 )
by Alain
02:10
created

InvalidEmailAddress::from()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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 InvalidEmailAddress.
18
 *
19
 * @since   1.0.0
20
 *
21
 * @package BrightNucleus\Chainmail\Exception
22
 * @author  Alain Schlesser <[email protected]>
23
 */
24
class InvalidEmailAddress extends RuntimeException implements ChainmailException
25
{
26
27
    /**
28
     * Create an InvalidEmailAddress exception based on a specific email.
29
     *
30
     * @param string $email Email that failed validation.
31
     *
32
     * @return static
33
     */
34
    public static function from($email)
35
    {
36
        return new static(sprintf('Invalid email address: "%1$s".', $email));
37
    }
38
}
39