protected function parseRange($input): ?array
    {
        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) {
            [$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;
    }
protected function parseRange($input): ?array
    {
        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) {
            [$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;
    }
protected function parseRange ( $ input ) : ? array { 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 ) { [ $ 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 ; }
Parse IP range

@param  string $input

@return array|null
@throws \Bluz\Validator\Exception\ComponentException
Parse IP range