@@ -23,7 +23,6 @@ discard block |
||
23 | 23 | * * Countable : number of addresses |
24 | 24 | * * ArrayAccess : Address can be acceesed by offset (ex : $range[10]) |
25 | 25 | * * IteratorAggregate : range can be itrated (foreach) |
26 | - |
|
27 | 26 | * @package IPTools |
28 | 27 | */ |
29 | 28 | class Subnet implements IP, \Countable, \ArrayAccess, \IteratorAggregate |
@@ -37,7 +36,6 @@ discard block |
||
37 | 36 | * Netmask of the subnet |
38 | 37 | * |
39 | 38 | * Stored as a 32 bits integer |
40 | - |
|
41 | 39 | * /24 => 255.255.255.0 => 0xffffff00 |
42 | 40 | * |
43 | 41 | * @var int nemask |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @see https://en.wikipedia.org/wiki/Classful_network |
37 | 37 | */ |
38 | 38 | const CLASS_A = "A", |
39 | - CLASS_B = "B", |
|
40 | - CLASS_C = "C", |
|
41 | - CLASS_D = "D", |
|
42 | - CLASS_E = "E"; |
|
39 | + CLASS_B = "B", |
|
40 | + CLASS_C = "C", |
|
41 | + CLASS_D = "D", |
|
42 | + CLASS_E = "E"; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * IPv4 addresses are stored as a 32 bits integer |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | * @param self $address |
405 | 405 | * @return bool |
406 | 406 | */ |
407 | - public function match(Address $address) |
|
407 | + public function match(Address $address) |
|
408 | 408 | { |
409 | 409 | return $this->int() == $address->int(); |
410 | 410 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function offsetExists($offset) |
150 | 150 | { |
151 | - if (is_string($offset)) |
|
151 | + if (is_string($offset)) |
|
152 | 152 | { |
153 | 153 | if (!preg_match('/^-?[0-9]+$/', $offset)) |
154 | 154 | { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | $offset = (int)$offset; |
158 | 158 | } |
159 | - if (!is_int($offset)) |
|
159 | + if (!is_int($offset)) |
|
160 | 160 | { |
161 | 161 | throw new InvalidArgumentException(sprintf('Invalid key type (%s), only integers or strings representing integers can be used to acces address in a Range', gettype($offset))); |
162 | 162 | } |