Code Duplication    Length = 13-13 lines in 2 locations

src/PhpSpreadsheet/Writer/Xls.php 2 locations

@@ 710-722 (lines=13) @@
707
                    $dataSection_Content .= pack('V', 0x0001);
708
                }
709
                $dataSection_Content_Offset += 4 + 4;
710
            } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
711
                // Null-terminated string
712
                $dataProp['data']['data'] .= chr(0);
713
                $dataProp['data']['length'] += 1;
714
                // Complete the string with null string for being a %4
715
                $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4));
716
                $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT);
717
718
                $dataSection_Content .= pack('V', $dataProp['data']['length']);
719
                $dataSection_Content .= $dataProp['data']['data'];
720
721
                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
722
            } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
723
                $dataSection_Content .= $dataProp['data']['data'];
724
725
                $dataSection_Content_Offset += 4 + 8;
@@ 905-917 (lines=13) @@
902
                $dataSection_Content .= pack('V', $dataProp['data']['data']);
903
904
                $dataSection_Content_Offset += 4 + 4;
905
            } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
906
                // Null-terminated string
907
                $dataProp['data']['data'] .= chr(0);
908
                $dataProp['data']['length'] += 1;
909
                // Complete the string with null string for being a %4
910
                $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4));
911
                $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT);
912
913
                $dataSection_Content .= pack('V', $dataProp['data']['length']);
914
                $dataSection_Content .= $dataProp['data']['data'];
915
916
                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
917
            } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
918
                $dataSection_Content .= $dataProp['data']['data'];
919
920
                $dataSection_Content_Offset += 4 + 8;