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

createForCouldNotFindParameter() public static méthode

public static createForCouldNotFindParameter ( string $parameterKey ) : UnresolvableValueException
$parameterKey string
Résultat UnresolvableValueException
    public static function createForCouldNotFindParameter(string $parameterKey) : UnresolvableValueException
    {
        return new UnresolvableValueException(sprintf('Could not find the parameter "%s".', $parameterKey));
    }

Usage Example

 /**
  * {@inheritdoc}
  *
  * @param ParameterValue $value
  *
  * @throws UnresolvableValueException
  */
 public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
 {
     $parameterKey = $value->getValue();
     $parameters = $fixtureSet->getParameters();
     if (false === $parameters->has($parameterKey)) {
         throw UnresolvableValueExceptionFactory::createForCouldNotFindParameter($parameterKey);
     }
     return new ResolvedValueWithFixtureSet($parameters->get($parameterKey), $fixtureSet);
 }