private function validateBatch(array $input, $type, callable $additionalCheck = null)
{
foreach ($input as $element) {
if (!$element instanceof $type) {
throw new InvalidArgumentException(sprintf('Each member of input array must be an instance of %s', $type));
}
if ($additionalCheck) {
$additionalCheck($element);
}
}
}