Code Duplication    Length = 5-6 lines in 2 locations

src/POData/UriProcessor/UriProcessorNew.php 2 locations

@@ 325-329 (lines=5) @@
322
            $requestTargetKind = $segment->getTargetKind();
323
            if ($requestTargetKind == TargetKind::RESOURCE()) {
324
                $resourceSet = $segment->getTargetResourceSetWrapper();
325
                if (!$resourceSet) {
326
                    $url = $this->getService()->getHost()->getAbsoluteRequestUri()->getUrlAsString();
327
                    $msg = Messages::badRequestInvalidUriForThisVerb($url, $requestMethod);
328
                    throw ODataException::createBadRequestError($msg);
329
                }
330
331
                $payload = $this->getRequest()->getData();
332
                assert($payload instanceof ODataEntry, get_class($payload));
@@ 374-379 (lines=6) @@
371
     */
372
    protected function checkUriValidForSuppliedVerb($resourceSet, $keyDescriptor, $requestMethod)
373
    {
374
        if (!$resourceSet || !$keyDescriptor) {
375
            $url = $this->getService()->getHost()->getAbsoluteRequestUri()->getUrlAsString();
376
            throw ODataException::createBadRequestError(
377
                Messages::badRequestInvalidUriForThisVerb($url, $requestMethod)
378
            );
379
        }
380
    }
381
382
    /**