Bluz\Validator\Rule\Ip::parseRange PHP Метод

parseRange() защищенный Метод

Parse IP range
protected parseRange ( string $input ) : array
$input string
Результат array
    protected function parseRange($input)
    {
        if ($input === null || $input == '*' || $input == '*.*.*.*' || $input == '0.0.0.0-255.255.255.255') {
            return null;
        }
        $range = ['min' => null, 'max' => null, 'mask' => null];
        if (strpos($input, '-') !== false) {
            list($range['min'], $range['max']) = explode('-', $input);
        } elseif (strpos($input, '*') !== false) {
            $this->parseRangeUsingWildcards($input, $range);
        } elseif (strpos($input, '/') !== false) {
            $this->parseRangeUsingCidr($input, $range);
        } else {
            throw new ComponentException('Invalid network range');
        }
        if (!$this->verifyAddress($range['min'])) {
            throw new ComponentException('Invalid network range');
        }
        if (isset($range['max']) && !$this->verifyAddress($range['max'])) {
            throw new ComponentException('Invalid network range');
        }
        return $range;
    }