Completed
Push — master ( 59b106...2838f8 )
by Peter
03:34
created

InvalidMaskException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A cidr() 0 4 1
A ip() 0 4 1
1
<?php
2
3
/**
4
 * GpsLab component.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2016, Peter Gribanov
8
 * @license   http://opensource.org/licenses/MIT
9
 */
10
11
namespace GpsLab\Component\Interval\IPv4Network;
12
13
class InvalidMaskException extends \InvalidArgumentException
14
{
15
    /**
16
     * @param int $cidr
17
     *
18
     * @return InvalidMaskException
19
     */
20
    public static function cidr($cidr)
21
    {
22
        return new self(sprintf('The CIDR mask must be equal 0-32. Actual CIDR mask is "%s".', $cidr));
23
    }
24
25
    /**
26
     * @param string $ip
27
     *
28
     * @return self
29
     */
30
    public static function ip($ip)
31
    {
32
        return new self(sprintf('The example of expected IP mask is "255.255.255.0". Actual IP mask is "%s".', $ip));
33
    }
34
}
35