/** * Method to filter the subnets to confirm their validity * * @param string|array $subnets * @return array */ protected function filterSubnets($subnets) { $validSubnets = array(); if (!is_array($subnets)) { $subnets = array($subnets); } foreach ($subnets as $subnet) { $subnet = trim($subnet); if (Validator\Subnet::factory()->evaluate($subnet)) { $validSubnets[] = $subnet; } } return $validSubnets; }