Code Duplication    Length = 11-14 lines in 2 locations

src/Subjects/AbstractProductSubject.php 2 locations

@@ 636-646 (lines=11) @@
633
        $cleanUpColumns = $this->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_EMPTY_COLUMNS);
634
635
        // query whether or not the image columns has to be cleaned-up also
636
        if ($this->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_EMPTY_IMAGE_COLUMNS) &&
637
            $this->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_EMPTY_IMAGE_COLUMNS, false)
638
        ) {
639
            // if yes load the image column names
640
            $imageTypes = array_keys($this->getImageTypes());
641
642
            // and append them to the column names from the configuration
643
            foreach ($imageTypes as $imageAttribute) {
644
                $cleanUpColumns[] = $this->mapAttributeCodeByHeaderMapping($imageAttribute);
645
            }
646
        }
647
648
        // query whether or not the columns with the product links has to be cleaned-up also
649
        if ($this->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_LINKS) &&
@@ 649-662 (lines=14) @@
646
        }
647
648
        // query whether or not the columns with the product links has to be cleaned-up also
649
        if ($this->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_LINKS) &&
650
            $this->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_LINKS, false)
651
        ) {
652
            // load the link type mappings
653
            $linkTypeMappings = $this->getLinkTypeMappings();
654
655
            // prepare the links for the found link types and clean up
656
            foreach ($linkTypeMappings as $columns) {
657
                // shift the column with the header information from the stack
658
                list ($columnNameChildSkus, ) = array_shift($columns);
659
                // append the column name from the link type mapping
660
                $cleanUpColumns[] = $columnNameChildSkus;
661
            }
662
        }
663
664
        // return the array with the column names that has to be cleaned-up
665
        return $cleanUpColumns;