notifiers[$notificationMethodName] = $notifier; } /** * @param string $notificationMethodName * @return ValidationNotifier */ public function getNotifier($notificationMethodName) { if (! isset($this->notifiers[$notificationMethodName])) { throw new InvalidArgumentException(sprintf('Undefined notifier for method: %s', $notificationMethodName)); } return $this->notifiers[$notificationMethodName]; } }