Code Duplication    Length = 8-8 lines in 7 locations

src/PhpSpreadsheet/Writer/Xls.php 7 locations

@@ 561-568 (lines=8) @@
558
        ++$dataSection_NumProps;
559
560
        // GKPIDDSI_CATEGORY : Category
561
        if ($this->spreadsheet->getProperties()->getCategory()) {
562
            $dataProp = $this->spreadsheet->getProperties()->getCategory();
563
            $dataSection[] = [
564
                'summary' => ['pack' => 'V', 'data' => 0x02],
565
                'offset' => ['pack' => 'V'],
566
                'type' => ['pack' => 'V', 'data' => 0x1E],
567
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
568
            ];
569
            ++$dataSection_NumProps;
570
        }
571
        // GKPIDDSI_VERSION :Version of the application that wrote the property storage
@@ 775-782 (lines=8) @@
772
        ++$dataSection_NumProps;
773
774
        //    Title
775
        if ($this->spreadsheet->getProperties()->getTitle()) {
776
            $dataProp = $this->spreadsheet->getProperties()->getTitle();
777
            $dataSection[] = [
778
                'summary' => ['pack' => 'V', 'data' => 0x02],
779
                'offset' => ['pack' => 'V'],
780
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
781
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
782
            ];
783
            ++$dataSection_NumProps;
784
        }
785
        //    Subject
@@ 786-793 (lines=8) @@
783
            ++$dataSection_NumProps;
784
        }
785
        //    Subject
786
        if ($this->spreadsheet->getProperties()->getSubject()) {
787
            $dataProp = $this->spreadsheet->getProperties()->getSubject();
788
            $dataSection[] = [
789
                'summary' => ['pack' => 'V', 'data' => 0x03],
790
                'offset' => ['pack' => 'V'],
791
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
792
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
793
            ];
794
            ++$dataSection_NumProps;
795
        }
796
        //    Author (Creator)
@@ 797-804 (lines=8) @@
794
            ++$dataSection_NumProps;
795
        }
796
        //    Author (Creator)
797
        if ($this->spreadsheet->getProperties()->getCreator()) {
798
            $dataProp = $this->spreadsheet->getProperties()->getCreator();
799
            $dataSection[] = [
800
                'summary' => ['pack' => 'V', 'data' => 0x04],
801
                'offset' => ['pack' => 'V'],
802
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
803
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
804
            ];
805
            ++$dataSection_NumProps;
806
        }
807
        //    Keywords
@@ 808-815 (lines=8) @@
805
            ++$dataSection_NumProps;
806
        }
807
        //    Keywords
808
        if ($this->spreadsheet->getProperties()->getKeywords()) {
809
            $dataProp = $this->spreadsheet->getProperties()->getKeywords();
810
            $dataSection[] = [
811
                'summary' => ['pack' => 'V', 'data' => 0x05],
812
                'offset' => ['pack' => 'V'],
813
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
814
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
815
            ];
816
            ++$dataSection_NumProps;
817
        }
818
        //    Comments (Description)
@@ 819-826 (lines=8) @@
816
            ++$dataSection_NumProps;
817
        }
818
        //    Comments (Description)
819
        if ($this->spreadsheet->getProperties()->getDescription()) {
820
            $dataProp = $this->spreadsheet->getProperties()->getDescription();
821
            $dataSection[] = [
822
                'summary' => ['pack' => 'V', 'data' => 0x06],
823
                'offset' => ['pack' => 'V'],
824
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
825
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
826
            ];
827
            ++$dataSection_NumProps;
828
        }
829
        //    Last Saved By (LastModifiedBy)
@@ 830-837 (lines=8) @@
827
            ++$dataSection_NumProps;
828
        }
829
        //    Last Saved By (LastModifiedBy)
830
        if ($this->spreadsheet->getProperties()->getLastModifiedBy()) {
831
            $dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy();
832
            $dataSection[] = [
833
                'summary' => ['pack' => 'V', 'data' => 0x08],
834
                'offset' => ['pack' => 'V'],
835
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
836
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
837
            ];
838
            ++$dataSection_NumProps;
839
        }
840
        //    Created Date/Time