Skip to content

Commit

Permalink
fix colLetterRange()
Browse files Browse the repository at this point in the history
  • Loading branch information
aVadim483 committed Oct 26, 2023
1 parent 13869cd commit 1978c15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/FastExcelHelper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ public static function colLetterRange($colKeys, ?int $baseNum = 0): array
return $columns;
}
else {
$columns = $colKeys;
$res = [];
foreach ($colKeys as $col) {
$res[] = self::colLetterRange($col);
}
$columns = array_merge(...$res);
}
return $columns;
}
Expand Down
1 change: 1 addition & 0 deletions tests/FastExcelHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function testExcelHelper()
$this->assertEquals(['', 'A', 'B'], Helper::colLetterRange([0, 1, 2], 1));
$this->assertEquals(['B', 'E', 'F'], Helper::colLetterRange('B, E, F'));
$this->assertEquals(['B', 'C', 'D', 'E', 'F'], Helper::colLetterRange('B-E, F'));
$this->assertEquals(['B', 'C', 'D', 'E', 'F'], Helper::colLetterRange(['B-E', 'F']));
$this->assertEquals(['B', 'C', 'D', 'E'], Helper::colLetterRange('B1-E8'));
$this->assertEquals(['B:E'], Helper::colLetterRange('B1:E8'));
$this->assertEquals(['B:E'], Helper::colLetterRange('$B1:E$8'));
Expand Down

0 comments on commit 1978c15

Please sign in to comment.