From 48c857bbbc864436cabae7449f4fd2160594f420 Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Fri, 22 Feb 2019 09:35:20 +1100 Subject: [PATCH] Add support for league/csv:^9.0 --- src/datatypes/Csv.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/datatypes/Csv.php b/src/datatypes/Csv.php index 0f06bb12..39658d06 100644 --- a/src/datatypes/Csv.php +++ b/src/datatypes/Csv.php @@ -125,6 +125,14 @@ private function _getRows($reader) } } catch (\Throwable $e) {} + // Support league/csv v9 syntax + try { + if (!$array) { + $reader->setHeaderOffset(0); + $array = $reader->getRecords(); + } + } catch (\Throwable $e) {} + return $array; }