public function hydrate(ObjectInterface $object, Property $property, GenerationContext $context) : ObjectInterface
{
$instance = $object->getInstance();
try {
$this->propertyAccessor->setValue($instance, $property->getName(), $property->getValue());
} catch (SymfonyNoSuchPropertyException $exception) {
throw HydrationExceptionFactory::createForCouldNotHydrateObjectWithProperty($object, $property, 0, $exception);
} catch (SymfonyAccessException $exception) {
throw HydrationExceptionFactory::createForInaccessibleProperty($object, $property, 0, $exception);
} catch (SymfonyInvalidArgumentException $exception) {
throw HydrationExceptionFactory::createForInvalidProperty($object, $property, 0, $exception);
} catch (SymfonyPropertyAccessException $exception) {
throw HydrationExceptionFactory::create($object, $property, 0, $exception);
}
return new SimpleObject($object->getId(), $instance);
}