Nelmio\Alice\Generator\Instantiator\InstantiatorResolver::resolveArguments PHP Method

resolveArguments() private method

private resolveArguments ( array $arguments, Nelmio\Alice\Generator\ValueResolverInterface $resolver, Nelmio\Alice\FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, GenerationContext $context ) : array
$arguments array
$resolver Nelmio\Alice\Generator\ValueResolverInterface
$fixture Nelmio\Alice\FixtureInterface
$fixtureSet Nelmio\Alice\Generator\ResolvedFixtureSet
$context Nelmio\Alice\Generator\GenerationContext
return array The first element is an array ($arguments) which is the resolved arguments and the second the new ResolvedFixtureSet which may contains new fixtures (from the arguments resolution)
    private function resolveArguments(array $arguments, ValueResolverInterface $resolver, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, GenerationContext $context) : array
    {
        foreach ($arguments as $index => $argument) {
            if ($argument instanceof ValueInterface) {
                try {
                    $result = $resolver->resolve($argument, $fixture, $fixtureSet, [], $context);
                } catch (ResolutionThrowable $throwable) {
                    throw UnresolvableValueDuringGenerationExceptionFactory::createFromResolutionThrowable($throwable);
                }
                $fixtureSet = $result->getSet();
                $arguments[$index] = $result->getValue();
            }
        }
        return [$arguments, $fixtureSet];
    }