yii\validators\IpValidator::prepareRanges PHP Method

prepareRanges() private method

Prepares array to fill in [[ranges]]: - Recursively substitutes aliases, described in [[networks]] with their values - Removes duplicates
See also: networks
private prepareRanges ( $ranges ) : array
$ranges
return array
    private function prepareRanges($ranges)
    {
        $result = [];
        foreach ($ranges as $string) {
            list($isRangeNegated, $range) = $this->parseNegatedRange($string);
            if (isset($this->networks[$range])) {
                $replacements = $this->prepareRanges($this->networks[$range]);
                foreach ($replacements as &$replacement) {
                    list($isReplacementNegated, $replacement) = $this->parseNegatedRange($replacement);
                    $result[] = ($isRangeNegated && !$isReplacementNegated ? static::NEGATION_CHAR : '') . $replacement;
                }
            } else {
                $result[] = $string;
            }
        }
        return array_unique($result);
    }