Google\Cloud\ValidateTrait::validateBatch PHP Method

validateBatch() private method

Check that each member of $input array is of type $type.
private validateBatch ( array $input, string $type, callable $additionalCheck = null ) : void
$input array The input to validate.
$type string The type to check.
$additionalCheck callable
return void
    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);
            }
        }
    }
ValidateTrait