Code Duplication    Length = 16-17 lines in 2 locations

Core/Matcher/ContentMatcher.php 1 location

@@ 220-235 (lines=16) @@
217
     * @return Content[]
218
     * @deprecated
219
     */
220
    protected function findContentsByParentLocationIds($parentLocationIds)
221
    {
222
        $query = new Query();
223
        $query->limit = self::INT_MAX_16BIT;
224
        if (isset($query->performCount)) $query->performCount = false;
225
        $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds);
226
        $results = $this->repository->getSearchService()->findContent($query);
227
228
        $contents = [];
229
        foreach ($results->searchHits as $result) {
230
            // make sure we return every object only once
231
            $contents[$result->valueObject->contentInfo->id] = $result->valueObject;
232
        }
233
234
        return $contents;
235
    }
236
237
    /**
238
     * @param string[] $remoteParentLocationIds

Core/Matcher/LocationMatcher.php 1 location

@@ 211-227 (lines=17) @@
208
     * @return Location[]
209
     * @deprecated
210
     */
211
    protected function findLocationsByParentLocationIds($parentLocationIds)
212
    {
213
        $query = new LocationQuery();
214
        $query->limit = self::INT_MAX_16BIT;
215
        if (isset($query->performCount)) $query->performCount = false;
216
        $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds);
217
218
        $results = $this->repository->getSearchService()->findLocations($query);
219
220
        $locations = [];
221
222
        foreach ($results->searchHits as $result) {
223
            $locations[$result->valueObject->id] = $result->valueObject;
224
        }
225
226
        return $locations;
227
    }
228
229
    /**
230
     * @param int[] $parentLocationRemoteIds