code: static public function isValidType($type, $throw = true)
      {
          if (in_array($type, static::getTypes(), true)) {
              return true;
          }
  
          if ($throw) {
              throw new InvalidArgumentException('Invalid notification type.');
          }
  
          return false;
      }
docs: Returns whether the given type is valid or not.
  
  @param string $type
  @param bool   $throw
  
  @return bool