diff options
Diffstat (limited to 'src/Reader.php')
-rw-r--r-- | src/Reader.php | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/Reader.php b/src/Reader.php index 5f4ec20..9a0e810 100644 --- a/src/Reader.php +++ b/src/Reader.php @@ -38,30 +38,6 @@ class Reader extends AbstractCsv protected $stream_filter_mode = STREAM_FILTER_READ; /** - * Intelligent Array Combine - * - * add or remove values from the $value array to - * match array $keys length before using PHP array_combine function - * - * @param array $keys - * @param array $value - * - * @return array - */ - protected static function combineArray(array $keys, array $value) - { - $nbKeys = count($keys); - $diff = $nbKeys - count($value); - if ($diff > 0) { - $value = array_merge($value, array_fill(0, $diff, null)); - } elseif ($diff < 0) { - $value = array_slice($value, 0, $nbKeys); - } - - return array_combine($keys, $value); - } - - /** * Return a Filtered Iterator * * @param callable $callable a callable function to be applied to each Iterator item @@ -178,6 +154,30 @@ class Reader extends AbstractCsv } /** + * Intelligent Array Combine + * + * add or remove values from the $value array to + * match array $keys length before using PHP array_combine function + * + * @param array $keys + * @param array $value + * + * @return array + */ + protected static function combineArray(array $keys, array $value) + { + $nbKeys = count($keys); + $diff = $nbKeys - count($value); + if ($diff > 0) { + $value = array_merge($value, array_fill(0, $diff, null)); + } elseif ($diff < 0) { + $value = array_slice($value, 0, $nbKeys); + } + + return array_combine($keys, $value); + } + + /** * Return a single column from the CSV data * * The callable function will be applied to each value to be return |