Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }
 public function execute(IAction $action)
 {
     $action->execute();
 }