code: public function setTriggerType($type)
      {
          if (!array_key_exists($type, $this->validTypes)) {
              throw new \InvalidArgumentException('The type MUST be one of:' . implode(',', $this->validTypes));
          }
  
          $this->type = $this->validTypes[$type];
          $this->typeAlias = $type;
      }
docs: Sets trigger type.
  
  {@inheritdoc}