Code Duplication    Length = 6-6 lines in 2 locations

eZ/Publish/Core/Repository/LocationService.php 2 locations

@@ 250-255 (lines=6) @@
247
        );
248
249
        $locations = [];
250
        foreach ($spiLocations as $spiLocation) {
251
            $location = $this->domainMapper->buildLocationDomainObject($spiLocation);
252
            if ($this->repository->canUser('content', 'read', $location->getContentInfo(), $location)) {
253
                $locations[] = $location;
254
            }
255
        }
256
257
        return $locations;
258
    }
@@ 322-327 (lines=6) @@
319
320
        $locations = [];
321
        $permissionResolver = $this->repository->getPermissionResolver();
322
        foreach ($spiLocations as $spiLocation) {
323
            $location = $this->domainMapper->buildLocationDomainObject($spiLocation);
324
            if ($permissionResolver->canUser('content', 'read', $location->getContentInfo(), [$location])) {
325
                $locations[] = $location;
326
            }
327
        }
328
329
        return $locations;
330
    }