public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
{
if (null === $this->resolver) {
throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
}
$context->markAsNeedsCompleteGeneration();
$fixtureReferenceResult = $this->resolver->resolve($value->getReference(), $fixture, $fixtureSet, $scope, $context);
$context->unmarkAsNeedsCompleteGeneration();
/** @var ResolvedFixtureSet $fixtureSet */
list($instance, $fixtureSet) = [$fixtureReferenceResult->getValue(), $fixtureReferenceResult->getSet()];
try {
$propertyValue = $this->propertyAccessor->getValue($instance, $value->getProperty());
} catch (SymfonyNoSuchPropertyException $exception) {
throw NoSuchPropertyExceptionFactory::createForFixture($fixture, $value, 0, $exception);
} catch (\Exception $exception) {
throw UnresolvableValueExceptionFactory::create($value, 0, $exception);
}
return new ResolvedValueWithFixtureSet($propertyValue, $fixtureSet);
}