Code Duplication    Length = 5-6 lines in 2 locations

src/POData/UriProcessor/UriProcessorNew.php 2 locations

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