public function validation($data, $files) {
        $errors = [];
        if (isset($data['purgeselectedcaches']) && empty(array_filter($data['purgeselectedoptions']))) {
            $errors['purgeselectedoptions'] = get_string('purgecachesnoneselected', 'admin');
        }
        return $errors;
    }
public function validation($data, $files) {
        $errors = [];
        if (isset($data['purgeselectedcaches']) && empty(array_filter($data['purgeselectedoptions']))) {
            $errors['purgeselectedoptions'] = get_string('purgecachesnoneselected', 'admin');
        }
        return $errors;
    }
public function validation ( $ data , $ files ) { $ errors = [ ] ; if ( isset ( $ data [ 'purgeselectedcaches' ] ) && empty ( array_filter ( $ data [ 'purgeselectedoptions' ] ) ) ) { $ errors [ 'purgeselectedoptions' ] = get_string ( 'purgecachesnoneselected' , 'admin' ) ; } return $ errors ; }
If the "Purge selected caches" button was pressed, ensure at least one cache was selected.

@param array $data
@param array $files
@return array Error messages
If the Purge selected caches button was pressed ensure at least one cache was selected .