Upstream thephpleague/csv state of the touched files before 3426bb277e

This commit is contained in:
upstream committed 2026-09-04 09:31:11 +02:00
1 parent e77df85d0c
commit 4354a49e5b
2 files changed
+9 -22

No files matched your search

+9 -4
View File
@@ -335,11 +335,16 @@ final class Buffer implements TabularData
private function nthRow(int $nth, string $method): array
{
-1 < $nth || throw InvalidArgument::dueToInvalidRecordOffset($nth, $method);
if (null === ($first = $this->firstOffset())) {
return [];
}
// $nth is a positional index (like ResultSet::nth), so it must be
// resolved against the record order rather than the row keys, which
// may contain gaps after records have been deleted.
return array_values($this->rows)[$nth] ?? [];
$offset = $first + $nth;
if (!array_key_exists($offset, $this->rows)) {
return [];
}
return $this->rows[$nth + $first];
}
public function fetchColumn(int|string $index = 0): Iterator