/**
* @param FixtureInterface $fixture
* @param ResolvedFixtureSet $set
* @param GenerationContext $context
*
* @throws UnresolvableValueDuringGenerationException
*
* @return array
*/
private function resolveFixtureConstructor(FixtureInterface $fixture, ResolvedFixtureSet $set, GenerationContext $context) : array
{
$specs = $fixture->getSpecs();
$constructor = $specs->getConstructor();
if (null === $constructor || $constructor instanceof NoMethodCall) {
return [$fixture, $set];
}
if (null === $this->valueResolver) {
throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
}
list($resolvedArguments, $set) = $this->resolveArguments($constructor->getArguments(), $this->valueResolver, $fixture, $set, $context);
return [$fixture->withSpecs($specs->withConstructor($constructor->withArguments($resolvedArguments))), $set];
}