@@ -56,25 +56,25 @@ |
||
| 56 | 56 | |
| 57 | 57 | foreach(array_keys(self::$ipAddress) as $type) { |
| 58 | 58 | switch ($type) { |
| 59 | - case 'static': |
|
| 60 | - $result = array_filter(self::$ipAddress[$type], function($ipAddress) use($onPageIpAddress) { |
|
| 61 | - return in_array($ipAddress, $onPageIpAddress); |
|
| 62 | - }); |
|
| 63 | - break; |
|
| 64 | - case 'regexp': |
|
| 65 | - $result = array_filter(self::$ipAddress[$type], function($regExp) use($onPageIpAddress) { |
|
| 66 | - $existsPatten = []; |
|
| 67 | - foreach ($onPageIpAddress as $ipAddress) { |
|
| 68 | - if (preg_match($regExp, $ipAddress) === 1) { |
|
| 69 | - $existsPatten[] = $ipAddress; |
|
| 59 | + case 'static': |
|
| 60 | + $result = array_filter(self::$ipAddress[$type], function($ipAddress) use($onPageIpAddress) { |
|
| 61 | + return in_array($ipAddress, $onPageIpAddress); |
|
| 62 | + }); |
|
| 63 | + break; |
|
| 64 | + case 'regexp': |
|
| 65 | + $result = array_filter(self::$ipAddress[$type], function($regExp) use($onPageIpAddress) { |
|
| 66 | + $existsPatten = []; |
|
| 67 | + foreach ($onPageIpAddress as $ipAddress) { |
|
| 68 | + if (preg_match($regExp, $ipAddress) === 1) { |
|
| 69 | + $existsPatten[] = $ipAddress; |
|
| 70 | + } |
|
| 70 | 71 | } |
| 71 | - } |
|
| 72 | 72 | |
| 73 | - return count($existsPatten) !== 0; |
|
| 74 | - }); |
|
| 75 | - break; |
|
| 76 | - default: |
|
| 77 | - throw new \InvalidArgumentException("invalid type"); |
|
| 73 | + return count($existsPatten) !== 0; |
|
| 74 | + }); |
|
| 75 | + break; |
|
| 76 | + default: |
|
| 77 | + throw new \InvalidArgumentException("invalid type"); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | if (count($result) !== 0) { |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | |
| 55 | 55 | $onPageIpAddress = $matches['ipaddress']; |
| 56 | 56 | |
| 57 | - foreach(array_keys(self::$ipAddress) as $type) { |
|
| 57 | + foreach (array_keys(self::$ipAddress) as $type) { |
|
| 58 | 58 | switch ($type) { |
| 59 | 59 | case 'static': |
| 60 | 60 | $result = array_filter(self::$ipAddress[$type], function($ipAddress) use($onPageIpAddress) { |