Code Duplication    Length = 11-14 lines in 2 locations

src/Subjects/AbstractProductSubject.php 2 locations

@@ 895-905 (lines=11) @@
892
        }
893
894
        // query whether or not the image columns has to be cleaned-up also
895
        if ($this->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_EMPTY_IMAGE_COLUMNS) &&
896
            $this->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_EMPTY_IMAGE_COLUMNS, false)
897
        ) {
898
            // if yes load the image column names
899
            $imageTypes = array_keys($this->getImageTypes());
900
901
            // and append them to the column names from the configuration
902
            foreach ($imageTypes as $imageAttribute) {
903
                $cleanUpColumns[] = $this->mapAttributeCodeByHeaderMapping($imageAttribute);
904
            }
905
        }
906
907
        // query whether or not the columns with the product links has to be cleaned-up also
908
        if ($this->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_LINKS) &&
@@ 908-921 (lines=14) @@
905
        }
906
907
        // query whether or not the columns with the product links has to be cleaned-up also
908
        if ($this->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_LINKS) &&
909
            $this->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_LINKS, false)
910
        ) {
911
            // load the link type mappings
912
            $linkTypeMappings = $this->getLinkTypeMappings();
913
914
            // prepare the links for the found link types and clean up
915
            foreach ($linkTypeMappings as $columns) {
916
                // shift the column with the header information from the stack
917
                list ($columnNameChildSkus, ) = array_shift($columns);
918
                // append the column name from the link type mapping
919
                $cleanUpColumns[] = $columnNameChildSkus;
920
            }
921
        }
922
923
        // return the array with the column names that has to be cleaned-up
924
        return $cleanUpColumns;