form_validation.module
<?php
/**
* @file
* Module hooks and callbacks.
*/
/**
* File validation callback.
*
* Check the CSV is in the correct format, using commas as a separator, and
* with at least 2 columns per row.
*
* @see file_validate()
*
* @param \Drupal\file\FileInterface $file
* The file to be validated.
*
* @return array
* List of validation issues, if any.
*/
function form_validation_validate_csv(\Drupal\file\FileInterface $file) {
return \Drupal::service('form_validation.csv_parser')->validate($file);
}