/** * Validates given $intentions. * * @param ParametersIntentionInterface $intention * * @throws InvalidArgumentException */ protected function validate(ParametersIntentionInterface $intention) { $errors = $intention->validate(); if ($errors->count() > 0) { throw new InvalidArgumentException($errors); } }