mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
readded missing return statement in parse-function
This commit is contained in:
15
src/Csv.php
15
src/Csv.php
@@ -394,11 +394,11 @@ class Csv {
|
|||||||
* @return bool True on success
|
* @return bool True on success
|
||||||
*/
|
*/
|
||||||
public function parse($input = NULL, $offset = NULL, $limit = NULL, $conditions = NULL) {
|
public function parse($input = NULL, $offset = NULL, $limit = NULL, $conditions = NULL) {
|
||||||
if (!is_null($input)) {
|
if (is_null($input)) {
|
||||||
$this->file = $input;
|
$input = $this->file;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->file)) {
|
if (empty($input)) {
|
||||||
// todo: but why true?
|
// todo: but why true?
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -406,11 +406,12 @@ class Csv {
|
|||||||
$this->init($offset, $limit, $conditions);
|
$this->init($offset, $limit, $conditions);
|
||||||
|
|
||||||
|
|
||||||
if (strlen($this->file) <= PHP_MAXPATHLEN && is_readable($this->file)) {
|
if (strlen($input) <= PHP_MAXPATHLEN && is_readable($input)) {
|
||||||
$this->data = $this->parse_file($this->file);
|
$this->file = $input;
|
||||||
|
$this->data = $this->parse_file($input);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->file_data = &$this->file;
|
$this->file_data = &$input;
|
||||||
$this->data = $this->parse_string();
|
$this->data = $this->parse_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,6 +419,8 @@ class Csv {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user