Code Duplication    Length = 15-15 lines in 2 locations

src/PhpSpreadsheet/Writer/Xlsx/Style.php 2 locations

@@ 657-671 (lines=15) @@
654
     *
655
     * @return \PhpOffice\PhpSpreadsheet\Style\Font[] All fonts in PhpSpreadsheet
656
     */
657
    public function allFonts(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet)
658
    {
659
        // Get an array of unique fonts
660
        $aFonts = [];
661
        $aStyles = $this->allStyles($spreadsheet);
662
663
        /** @var \PhpOffice\PhpSpreadsheet\Style $style */
664
        foreach ($aStyles as $style) {
665
            if (!isset($aFonts[$style->getFont()->getHashCode()])) {
666
                $aFonts[$style->getFont()->getHashCode()] = $style->getFont();
667
            }
668
        }
669
670
        return $aFonts;
671
    }
672
673
    /**
674
     * Get an array of all borders.
@@ 682-696 (lines=15) @@
679
     *
680
     * @return \PhpOffice\PhpSpreadsheet\Style\Borders[] All borders in PhpSpreadsheet
681
     */
682
    public function allBorders(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet)
683
    {
684
        // Get an array of unique borders
685
        $aBorders = [];
686
        $aStyles = $this->allStyles($spreadsheet);
687
688
        /** @var \PhpOffice\PhpSpreadsheet\Style $style */
689
        foreach ($aStyles as $style) {
690
            if (!isset($aBorders[$style->getBorders()->getHashCode()])) {
691
                $aBorders[$style->getBorders()->getHashCode()] = $style->getBorders();
692
            }
693
        }
694
695
        return $aBorders;
696
    }
697
698
    /**
699
     * Get an array of all number formats.