Nelmio\Alice\Throwable\Exception\Generator\Resolver\UnresolvableValueExceptionFactory::create PHP Méthode

create() public static méthode

public static create ( Nelmio\Alice\Definition\ValueInterface $value, integer $code, Throwable $previous = null ) : UnresolvableValueException
$value Nelmio\Alice\Definition\ValueInterface
$code integer
$previous Throwable
Résultat UnresolvableValueException
    public static function create(ValueInterface $value, int $code = 0, \Throwable $previous = null) : UnresolvableValueException
    {
        return new UnresolvableValueException(sprintf('Could not resolve value "%s".', $value), $code, $previous);
    }

Usage Example

 /**
  * {@inheritdoc}
  *
  * @param FixtureReferenceValue $value
  *
  * @throws UnresolvableValueException
  */
 public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
 {
     if (null === $this->generator) {
         throw ObjectGeneratorNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
     }
     $referredFixtureId = $value->getValue();
     if ($referredFixtureId instanceof ValueInterface) {
         throw UnresolvableValueExceptionFactory::create($value);
     }
     $referredFixture = $this->getReferredFixture($referredFixtureId, $fixtureSet);
     return $this->resolveReferredFixture($referredFixture, $referredFixtureId, $fixtureSet, $context);
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\Generator\Resolver\UnresolvableValueExceptionFactory::create