Code Duplication    Length = 10-10 lines in 2 locations

src/POData/Providers/ProvidersWrapper.php 2 locations

@@ 831-840 (lines=10) @@
828
                = $targetResourceType
829
                    ->getInstanceType()
830
                    ->getName();
831
            if (!is_object($entityInstance)
832
                || !($entityInstance instanceof $entityName)
833
            ) {
834
                throw ODataException::createInternalServerError(
835
                    Messages::providersWrapperIDSQPMethodReturnsUnExpectedType(
836
                        $entityName,
837
                        'IQueryProvider::getRelatedResourceReference'
838
                    )
839
                );
840
            }
841
            foreach ($targetProperty->getResourceType()->getKeyProperties()
842
            as $keyName => $resourceProperty) {
843
                try {
@@ 887-896 (lines=10) @@
884
885
        $resourceType = $resourceSet->getResourceType();
886
        $entityName = $resourceType->getInstanceType()->getName();
887
        if (!is_object($entityInstance)
888
            || !($entityInstance instanceof $entityName)
889
        ) {
890
            throw ODataException::createInternalServerError(
891
                Messages::providersWrapperIDSQPMethodReturnsUnExpectedType(
892
                    $entityName,
893
                    $methodName
894
                )
895
            );
896
        }
897
898
        foreach ($keyDescriptor->getValidatedNamedValues()
899
        as $keyName => $valueDescription) {