Code Duplication    Length = 8-8 lines in 7 locations

src/PhpSpreadsheet/Writer/Excel5.php 7 locations

@@ 572-579 (lines=8) @@
569
        ++$dataSection_NumProps;
570
571
        // GKPIDDSI_CATEGORY : Category
572
        if ($this->spreadsheet->getProperties()->getCategory()) {
573
            $dataProp = $this->spreadsheet->getProperties()->getCategory();
574
            $dataSection[] = [
575
                'summary' => ['pack' => 'V', 'data' => 0x02],
576
                'offset' => ['pack' => 'V'],
577
                'type' => ['pack' => 'V', 'data' => 0x1E],
578
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
579
            ];
580
            ++$dataSection_NumProps;
581
        }
582
        // GKPIDDSI_VERSION :Version of the application that wrote the property storage
@@ 786-793 (lines=8) @@
783
        ++$dataSection_NumProps;
784
785
        //    Title
786
        if ($this->spreadsheet->getProperties()->getTitle()) {
787
            $dataProp = $this->spreadsheet->getProperties()->getTitle();
788
            $dataSection[] = [
789
                'summary' => ['pack' => 'V', 'data' => 0x02],
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
        //    Subject
@@ 797-804 (lines=8) @@
794
            ++$dataSection_NumProps;
795
        }
796
        //    Subject
797
        if ($this->spreadsheet->getProperties()->getSubject()) {
798
            $dataProp = $this->spreadsheet->getProperties()->getSubject();
799
            $dataSection[] = [
800
                'summary' => ['pack' => 'V', 'data' => 0x03],
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
        //    Author (Creator)
@@ 808-815 (lines=8) @@
805
            ++$dataSection_NumProps;
806
        }
807
        //    Author (Creator)
808
        if ($this->spreadsheet->getProperties()->getCreator()) {
809
            $dataProp = $this->spreadsheet->getProperties()->getCreator();
810
            $dataSection[] = [
811
                'summary' => ['pack' => 'V', 'data' => 0x04],
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
        //    Keywords
@@ 819-826 (lines=8) @@
816
            ++$dataSection_NumProps;
817
        }
818
        //    Keywords
819
        if ($this->spreadsheet->getProperties()->getKeywords()) {
820
            $dataProp = $this->spreadsheet->getProperties()->getKeywords();
821
            $dataSection[] = [
822
                'summary' => ['pack' => 'V', 'data' => 0x05],
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
        //    Comments (Description)
@@ 830-837 (lines=8) @@
827
            ++$dataSection_NumProps;
828
        }
829
        //    Comments (Description)
830
        if ($this->spreadsheet->getProperties()->getDescription()) {
831
            $dataProp = $this->spreadsheet->getProperties()->getDescription();
832
            $dataSection[] = [
833
                'summary' => ['pack' => 'V', 'data' => 0x06],
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
        //    Last Saved By (LastModifiedBy)
@@ 841-848 (lines=8) @@
838
            ++$dataSection_NumProps;
839
        }
840
        //    Last Saved By (LastModifiedBy)
841
        if ($this->spreadsheet->getProperties()->getLastModifiedBy()) {
842
            $dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy();
843
            $dataSection[] = [
844
                'summary' => ['pack' => 'V', 'data' => 0x08],
845
                'offset' => ['pack' => 'V'],
846
                'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
847
                'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
848
            ];
849
            ++$dataSection_NumProps;
850
        }
851
        //    Created Date/Time