Make return value of parseFile() explicit as false if parsing failed

In practise this changes nothing because $this->file_data would typically be empty.
The only exception is if the object was reused from a previous parsing operation.
This commit is contained in:
Fonata
2021-05-13 19:23:56 +02:00
committed by Fonata
parent 731900effe
commit 05826c2bbf

View File

@@ -612,13 +612,13 @@ class Csv {
$file = $this->file;
}
if (empty($this->file_data)) {
/**
* @see self::keep_file_data
* Usually, _parse_string will clean this
* Instead of leaving stale data for the next parseFile call behind.
*/
$this->load_data($file);
/**
* @see self::keep_file_data
* Usually, _parse_string will clean this
* Instead of leaving stale data for the next parseFile call behind.
*/
if (empty($this->file_data) && !$this->loadFile($file)) {
return false;
}
return !empty($this->file_data) ? $this->_parse_string() : false;