Code Duplication    Length = 13-13 lines in 2 locations

src/PhpSpreadsheet/Writer/Xls.php 2 locations

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