Code Duplication    Length = 9-12 lines in 2 locations

src/Worksheet.php 2 locations

@@ 808-819 (lines=12) @@
805
     * @param string $label    Alternative label
806
     * @param mixed $format The cell format
807
     */
808
    protected function writeUrlInternal(Range $range, $url, $label, $format = null)
809
    {
810
        // Strip URL type
811
        $url = preg_replace('/^internal:/', '', $url);
812
813
        if (strpos($url, '#') === 0) {
814
            $url = substr($url, 1);
815
        }
816
817
        $this->writeUrlLabel($range->getStartCell(), $url, $label, $format);
818
        $this->appendRecord('HyperlinkInternal', array($range, $url));
819
    }
820
821
    /**
822
     * Write links to external directory names such as 'c:\foo.xls',
@@ 830-838 (lines=9) @@
827
     * @param string $label    Alternative label
828
     * @param mixed $format The cell format
829
     */
830
    protected function writeUrlExternal(Range $range, $url, $label, $format = null)
831
    {
832
        // Strip URL type and change Unix dir separator to Dos style (if needed)
833
        $url = preg_replace('/^external:/', '', $url);
834
        $url = preg_replace('/\//', "\\", $url);
835
836
        $this->writeUrlLabel($range->getStartCell(), $url, $label, $format);
837
        $this->appendRecord('HyperlinkExternal', array($range, $url));
838
    }
839
840
    /**
841
     * @param Cell $cell