/** * @param IAction $action * @return $this * @throws \InvalidArgumentException if the action are invalid * @since 8.2.0 */ public function addParsedAction(IAction $action) { if (!$action->isValidParsed()) { throw new \InvalidArgumentException('The given parsed action is invalid'); } if ($action->isPrimary()) { if ($this->hasPrimaryParsedAction) { throw new \InvalidArgumentException('The notification already has a primary action'); } $this->hasPrimaryParsedAction = true; } $this->actionsParsed[] = $action; return $this; }
/** * @param IAction $action * @return $this * @throws \InvalidArgumentException if the action are invalid * @since 8.2.0 */ public function addParsedAction(IAction $action) { if (!$action->isValidParsed()) { throw new \InvalidArgumentException('The given parsed action is invalid'); } $this->actionsParsed[] = $action; return $this; }