Code Duplication    Length = 10-10 lines in 2 locations

src/POData/Providers/ProvidersWrapper.php 2 locations

@@ 803-812 (lines=10) @@
800
                    ->getResourceType()
801
                    ->getInstanceType()
802
                    ->getName();
803
            if (!is_object($entityInstance) 
804
                || !($entityInstance instanceof $entityName)
805
            ) {
806
                throw ODataException::createInternalServerError(
807
                    Messages::providersWrapperIDSQPMethodReturnsUnExpectedType(
808
                        $entityName, 
809
                        'IQueryProvider::getRelatedResourceReference'
810
                    )
811
                );
812
            }
813
814
            foreach ($targetProperty->getResourceType()->getKeyProperties() 
815
            as $keyName => $resourceProperty) {
@@ 864-873 (lines=10) @@
861
        }
862
863
        $entityName = $resourceSet->getResourceType()->getInstanceType()->getName();
864
        if (!is_object($entityInstance) 
865
            || !($entityInstance instanceof $entityName)
866
        ) {
867
            throw ODataException::createInternalServerError(
868
                Messages::providersWrapperIDSQPMethodReturnsUnExpectedType(
869
                    $entityName, 
870
                    $methodName
871
                )
872
            );
873
        }
874
875
        foreach ($keyDescriptor->getValidatedNamedValues() 
876
            as $keyName => $valueDescription) {