src/IpRange/IpWhitelist.php
private function constructWhiteListForKey(array $whitelist, $key, $class)
    {
        if (isset($whitelist[$key]) && is_array($whitelist[$key])) {
            return array_map(function ($range) use ($class) {
                return new $class($range);
            }, array_values($whitelist[$key]));
        } else {
            return array();
        }
    }
private function constructWhiteListForKey(array $whitelist, $key, $class)
    {
        if (isset($whitelist[$key]) && is_array($whitelist[$key])) {
            return array_map(function ($range) use ($class) {
                return new $class($range);
            }, array_values($whitelist[$key]));
        } else {
            return array();
        }
    }
private function constructWhiteListForKey ( array $ whitelist , $ key , $ class ) { if ( isset ( $ whitelist [ $ key ] ) && is_array ( $ whitelist [ $ key ] ) ) { return array_map ( function ( $ range ) use ( $ class ) { return new $ class ( $ range ) ; } , array_values ( $ whitelist [ $ key ] ) ) ; } else { return array ( ) ; } }
Constructs the whitelist for the given key. Each element in the
whitelist gets mapped from a string to an instance of an Ipv4Range or
Ipv6Range.
@param array $whitelist The input whitelist of ranges.
@param string $key The key to use from the input whitelist ('ipv4' or
'ipv6').
@param string $class Each range string gets mapped to an instance of the
specified $class.
@return array Returns an array of Ipv4Range or Ipv6Range elements.
Constructs the whitelist for the given key . Each element in the whitelist gets mapped from a string to an instance of an Ipv4Range or Ipv6Range .