Code Duplication    Length = 5-5 lines in 3 locations

src/PhpSpreadsheet/Writer/Html.php 3 locations

@@ 419-423 (lines=5) @@
416
417
        // Fetch sheets
418
        $sheets = [];
419
        if ($this->sheetIndex === null) {
420
            $sheets = $this->spreadsheet->getAllSheets();
421
        } else {
422
            $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex);
423
        }
424
425
        // Construct HTML
426
        $html = '';
@@ 535-539 (lines=5) @@
532
533
        // Fetch sheets
534
        $sheets = [];
535
        if ($this->sheetIndex === null) {
536
            $sheets = $this->spreadsheet->getAllSheets();
537
        } else {
538
            $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex);
539
        }
540
541
        // Construct HTML
542
        $html = '';
@@ 869-873 (lines=5) @@
866
867
        // Fetch sheets
868
        $sheets = [];
869
        if ($this->sheetIndex === null) {
870
            $sheets = $this->spreadsheet->getAllSheets();
871
        } else {
872
            $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex);
873
        }
874
875
        // Build styles per sheet
876
        foreach ($sheets as $sheet) {