Code Duplication    Length = 16-17 lines in 2 locations

Core/Matcher/ContentMatcher.php 1 location

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

Core/Matcher/LocationMatcher.php 1 location

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