/**
  * {@inheritdoc}
  *
  * @param FunctionCallValue $value
  */
 public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
 {
     /**
      * @var FakerGenerator $generator
      * @var string         $formatter
      */
     list($generator, $formatter) = $this->getGenerator($this->generatorFactory, $value->getName());
     return new ResolvedValueWithFixtureSet($generator->format($formatter, $value->getArguments()), $fixtureSet);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  *
  * @param FunctionCallValue $value
  */
 public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
 {
     if (null === $this->argumentResolver) {
         throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
     }
     $arguments = $value->getArguments();
     foreach ($arguments as $index => $argument) {
         if ($argument instanceof ValueInterface) {
             $resolvedSet = $this->argumentResolver->resolve($argument, $fixture, $fixtureSet, $scope, $context);
             $arguments[$index] = $resolvedSet->getValue();
             $fixtureSet = $resolvedSet->getSet();
         }
     }
     return $this->resolver->resolve(new FunctionCallValue($value->getName(), $arguments), $fixture, $fixtureSet, $scope, $context);
 }