Code Duplication    Length = 13-13 lines in 2 locations

src/PhpSpreadsheet/Writer/Xls.php 2 locations

@@ 696-708 (lines=13) @@
693
                    $dataSection_Content .= pack('V', 0x0001);
694
                }
695
                $dataSection_Content_Offset += 4 + 4;
696
            } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
697
                // Null-terminated string
698
                $dataProp['data']['data'] .= chr(0);
699
                $dataProp['data']['length'] += 1;
700
                // Complete the string with null string for being a %4
701
                $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4));
702
                $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT);
703
704
                $dataSection_Content .= pack('V', $dataProp['data']['length']);
705
                $dataSection_Content .= $dataProp['data']['data'];
706
707
                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
708
            } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
709
                $dataSection_Content .= $dataProp['data']['data'];
710
711
                $dataSection_Content_Offset += 4 + 8;
@@ 891-903 (lines=13) @@
888
                $dataSection_Content .= pack('V', $dataProp['data']['data']);
889
890
                $dataSection_Content_Offset += 4 + 4;
891
            } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
892
                // Null-terminated string
893
                $dataProp['data']['data'] .= chr(0);
894
                $dataProp['data']['length'] += 1;
895
                // Complete the string with null string for being a %4
896
                $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4));
897
                $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT);
898
899
                $dataSection_Content .= pack('V', $dataProp['data']['length']);
900
                $dataSection_Content .= $dataProp['data']['data'];
901
902
                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
903
            } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
904
                $dataSection_Content .= $dataProp['data']['data'];
905
906
                $dataSection_Content_Offset += 4 + 8;