/**
* {@inheritdoc}
*
* @param VariableValue $value
*
* @throws UnresolvableValueException
*/
public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
{
$variableName = $value->getValue();
if (array_key_exists($variableName, $scope)) {
return new ResolvedValueWithFixtureSet($scope[$variableName], $fixtureSet);
}
throw UnresolvableValueExceptionFactory::createForCouldNotFindVariable($value);
}