From 6f095c8a3c6bf061c25ea11423496fd461d74dac Mon Sep 17 00:00:00 2001 From: Smita Kumari Date: Wed, 26 Feb 2014 00:10:24 +0530 Subject: [PATCH 1/2] Feature Request #1418, added new function docblock Signed-off-by: Smita Kumari --- libraries/plugins/import/ImportCsv.class.php | 28 +++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/libraries/plugins/import/ImportCsv.class.php b/libraries/plugins/import/ImportCsv.class.php index 70e4a0b6df..53c4c79950 100644 --- a/libraries/plugins/import/ImportCsv.class.php +++ b/libraries/plugins/import/ImportCsv.class.php @@ -651,7 +651,24 @@ class ImportCsv extends AbstractImportCsv } } - + /** + * read the expected column_seperated_with String of length $csv_terminated_len from the $buffer + * into variable $ch and return the read string $ch + * @param string $buffer + * @param string $ch + * @param int $i + * @param int $csv_terminated_len + * @return string + */ + + public function readCsvTerminatedString($buffer, $ch, $i, $csv_terminated_len) + { + for ($j = 0; $j < $csv_terminated_len - 1; $j++) { + $i++; + $ch .= $buffer[$i]; + } + return $ch; + } /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ @@ -676,12 +693,5 @@ class ImportCsv extends AbstractImportCsv { $this->_analyze = $analyze; } - public function readCsvTerminatedString($buffer, $ch, $i, $csv_terminated_len) - { - for ($j = 0; $j < $csv_terminated_len - 1; $j++) { - $i++; - $ch .= $buffer[$i]; - } - return $ch; - } + } From a8052ee602be5570d6f2d8599d202cc034d3db1e Mon Sep 17 00:00:00 2001 From: Smita Kumari Date: Wed, 26 Feb 2014 17:19:56 +0530 Subject: [PATCH 2/2] adding explanation to parameter names Signed-off-by: Smita Kumari --- libraries/plugins/import/ImportCsv.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/plugins/import/ImportCsv.class.php b/libraries/plugins/import/ImportCsv.class.php index 53c4c79950..83f15c2c62 100644 --- a/libraries/plugins/import/ImportCsv.class.php +++ b/libraries/plugins/import/ImportCsv.class.php @@ -652,12 +652,12 @@ class ImportCsv extends AbstractImportCsv } /** - * read the expected column_seperated_with String of length $csv_terminated_len from the $buffer + * Read the expected column_seperated_with String of length $csv_terminated_len from the $buffer * into variable $ch and return the read string $ch - * @param string $buffer - * @param string $ch - * @param int $i - * @param int $csv_terminated_len + * @param string $buffer, The original string buffer read from csv file + * @param string $ch, Partially read "column Sepearted with" string, also used to return after reading length equal $csv_terminated_len + * @param int $i, Current read counter of buffer string + * @param int $csv_terminated_len, The length of "column seperated with" String. * @return string */