Code Duplication    Length = 16-17 lines in 2 locations

Core/Matcher/ContentMatcher.php 1 location

@@ 205-220 (lines=16) @@
202
     * @return Content[]
203
     * @deprecated
204
     */
205
    protected function findContentsByParentLocationIds($parentLocationIds)
206
    {
207
        $query = new Query();
208
        $query->limit = self::INT_MAX_16BIT;
209
        if (isset($query->performCount)) $query->performCount = false;
210
        $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds);
211
        $results = $this->repository->getSearchService()->findContent($query);
212
213
        $contents = [];
214
        foreach ($results->searchHits as $result) {
215
            // make sure we return every object only once
216
            $contents[$result->valueObject->contentInfo->id] = $result->valueObject;
217
        }
218
219
        return $contents;
220
    }
221
222
    /**
223
     * @param string[] $remoteParentLocationIds

Core/Matcher/LocationMatcher.php 1 location

@@ 196-212 (lines=17) @@
193
     * @return Location[]
194
     * @deprecated
195
     */
196
    protected function findLocationsByParentLocationIds($parentLocationIds)
197
    {
198
        $query = new LocationQuery();
199
        $query->limit = self::INT_MAX_16BIT;
200
        if (isset($query->performCount)) $query->performCount = false;
201
        $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds);
202
203
        $results = $this->repository->getSearchService()->findLocations($query);
204
205
        $locations = [];
206
207
        foreach ($results->searchHits as $result) {
208
            $locations[$result->valueObject->id] = $result->valueObject;
209
        }
210
211
        return $locations;
212
    }
213
214
    /**
215
     * @param int[] $parentLocationRemoteIds