/**
  * Creates an instance of OptionsResolver which is then configured and used by given $intention.
  *
  * @param ParametersIntentionInterface $intention
  * @throws InvalidArgumentException
  */
 protected function resolveParameters(ParametersIntentionInterface $intention)
 {
     $optionsResolver = new OptionsResolver();
     $intention->configureOptionsResolver($optionsResolver);
     try {
         $intention->resolveParameters($optionsResolver);
     } catch (ExceptionInterface $exception) {
         throw new InvalidArgumentException($exception->getMessage());
     }
 }