Code Duplication    Length = 10-10 lines in 2 locations

src/POData/Providers/ProvidersWrapper.php 2 locations

@@ 847-856 (lines=10) @@
844
					->getResourceType()
845
					->getInstanceType()
846
					->getName();
847
			if (!is_object($entityInstance)
848
				|| !($entityInstance instanceof $entityName)
849
			) {
850
				throw ODataException::createInternalServerError(
851
					Messages::providersWrapperIDSQPMethodReturnsUnExpectedType(
852
						$entityName,
853
						'IQueryProvider::getRelatedResourceReference'
854
					)
855
				);
856
			}
857
858
			foreach ($targetProperty->getResourceType()->getKeyProperties()
859
			as $keyName => $resourceProperty) {
@@ 909-918 (lines=10) @@
906
		}
907
908
		$entityName = $resourceSet->getResourceType()->getInstanceType()->getName();
909
		if (!is_object($entityInstance)
910
			|| !($entityInstance instanceof $entityName)
911
		) {
912
			throw ODataException::createInternalServerError(
913
				Messages::providersWrapperIDSQPMethodReturnsUnExpectedType(
914
					$entityName,
915
					$methodName
916
				)
917
			);
918
		}
919
920
		foreach ($keyDescriptor->getValidatedNamedValues()
921
			as $keyName => $valueDescription) {