Code Duplication    Length = 13-15 lines in 3 locations

Components/Helper.php 2 locations

@@ 160-174 (lines=15) @@
157
     * @param array $orderNumbers
158
     * @return array
159
     */
160
    public function getArticleIdsByNumber(array $orderNumbers)
161
    {
162
        $builder = $this->manager->getConnection()->createQueryBuilder();
163
164
        $rows = $builder->select('d.articleID as articleId')
165
            ->from('s_articles_details', 'd')
166
            ->where('d.ordernumber IN (:orderNumbers)')
167
            ->setParameter('orderNumbers', $orderNumbers, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
168
            ->execute()
169
            ->fetchAll();
170
171
        return array_map(function ($row) {
172
            return $row['articleId'];
173
        }, $rows);
174
    }
175
176
    /**
177
     * Returns article detail model by
@@ 823-835 (lines=13) @@
820
    /**
821
     * @return array
822
     */
823
    public function getAllNonConnectArticleIds()
824
    {
825
        $builder = $this->manager->getConnection()->createQueryBuilder();
826
        $builder->select('DISTINCT spci.article_id');
827
        $builder->from('s_plugin_connect_items', 'spci');
828
        $builder->where('spci.shop_id IS NULL');
829
830
        $result = $builder->execute()->fetchAll();
831
832
        return array_map(function ($row) {
833
            return $row['article_id'];
834
        }, $result);
835
    }
836
}
837

Components/ProductStream/ProductStreamRepository.php 1 location

@@ 376-389 (lines=14) @@
373
    /**
374
     * @return array
375
     */
376
    public function fetchConnectStreamIds()
377
    {
378
        $builder = $this->manager->getConnection()->createQueryBuilder();
379
380
        $results = $builder->select('sa.streamID')
381
            ->from('s_product_streams_attributes', 'sa')
382
            ->where('sa.connect_is_remote = 1')
383
            ->execute()
384
            ->fetchAll();
385
386
        return array_map(function ($item) {
387
            return $item['streamID'];
388
        }, $results);
389
    }
390
391
    /**
392
     * @param $streamId