Code Duplication    Length = 13-13 lines in 2 locations

src/PhpSpreadsheet/Writer/Excel5.php 2 locations

@@ 694-706 (lines=13) @@
691
                    $dataSection_Content .= pack('V', 0x0001);
692
                }
693
                $dataSection_Content_Offset += 4 + 4;
694
            } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
695
                // Null-terminated string
696
                $dataProp['data']['data'] .= chr(0);
697
                $dataProp['data']['length'] += 1;
698
                // Complete the string with null string for being a %4
699
                $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4)==4 ? 0 : (4 - $dataProp['data']['length'] % 4));
700
                $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT);
701
702
                $dataSection_Content .= pack('V', $dataProp['data']['length']);
703
                $dataSection_Content .= $dataProp['data']['data'];
704
705
                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
706
            } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
707
                $dataSection_Content .= $dataProp['data']['data'];
708
709
                $dataSection_Content_Offset += 4 + 8;
@@ 870-882 (lines=13) @@
867
                $dataSection_Content .= pack('V', $dataProp['data']['data']);
868
869
                $dataSection_Content_Offset += 4 + 4;
870
            } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
871
                // Null-terminated string
872
                $dataProp['data']['data'] .= chr(0);
873
                $dataProp['data']['length'] += 1;
874
                // Complete the string with null string for being a %4
875
                $dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4)==4 ? 0 : (4 - $dataProp['data']['length'] % 4));
876
                $dataProp['data']['data'] = str_pad($dataProp['data']['data'], $dataProp['data']['length'], chr(0), STR_PAD_RIGHT);
877
878
                $dataSection_Content .= pack('V', $dataProp['data']['length']);
879
                $dataSection_Content .= $dataProp['data']['data'];
880
881
                $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
882
            } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
883
                $dataSection_Content .= $dataProp['data']['data'];
884
885
                $dataSection_Content_Offset += 4 + 8;