Code Duplication    Length = 5-5 lines in 2 locations

Cron/Images.php 1 location

@@ 91-95 (lines=5) @@
88
                $client = $this->stockbaseClientFactory->create();
89
                $images = $client->getImages($eans);
90
                // validate returned images:
91
                if(is_array($images->{'Items'}) && count($images->{'Items'}) > 0) {
92
                    // download and save the images locally:
93
                    $newImagesCount = $this->imagesHelper->saveProductImages($images->{'Items'});
94
                    $this->logger->info('New synchronized images: '.$newImagesCount);
95
                }
96
            }
97
        } catch (Exception $e) {
98
            $this->logger->info('Cron runImageImport error: '.$e->getMessage());

Model/Observer/ProductSaveAfterObserver.php 1 location

@@ 77-81 (lines=5) @@
74
                $client = $this->stockbaseClientFactory->create();
75
                $images = $client->getImages([$ean]);
76
                // validate returned images:
77
                if(is_array($images->{'Items'}) && count($images->{'Items'}) > 0) {
78
                    // download and save the images locally:
79
                    $this->imagesHelper->saveProductImages($images->{'Items'});
80
                    $this->logger->debug('New images synchronized.');
81
                }
82
            }
83
        }
84
    }