mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
_validate_fields_for_unparse: more info in UnexpectedValueException
This commit is contained in:
@@ -857,7 +857,10 @@ class Csv {
|
||||
|
||||
// original titles are not given in fields. that is okay if count is okay.
|
||||
if (count($fields) != count($titlesOnParse)) {
|
||||
throw new \UnexpectedValueException('The specified fields do not match any titles and do not match column count.');
|
||||
throw new \UnexpectedValueException(
|
||||
"The specified fields do not match any titles and do not match column count.\n" .
|
||||
"\$fields was " . print_r($fields, true) .
|
||||
"\$titlesOnParse was " . print_r($titlesOnParse, true));
|
||||
}
|
||||
|
||||
return array_combine($titlesOnParse, $fields);
|
||||
|
||||
Reference in New Issue
Block a user