original_string: public function send(\BearFramework\Emails\Email $email): void
      {
          $app = App::get();
          $email = clone($email);
  
          if ($this->hasEventListeners('beforeSendEmail')) {
              $eventDetails = new \BearFramework\Emails\BeforeSendEmailEventDetails($email);
              $this->dispatchEvent('beforeSendEmail', $eventDetails);
              if ($eventDetails->preventDefault) {
                  return;
              }
          }
  
          if (empty($this->senders)) {
              throw new \Exception('No email senders added.');
          }
  
          foreach ($this->senders as $sender) {
              if (is_callable($sender)) {
                  $sender = call_user_func($sender);
              }
              if (is_string($sender)) {
                  $sender = new $sender();
              }
              if ($sender instanceof \BearFramework\Emails\ISender) {
                  if ($sender->send($email)) {
                      if ($this->hasEventListeners('sendEmail')) {
                          $eventDetails = new \BearFramework\Emails\SendEmailEventDetails($email);
                          $this->dispatchEvent('sendEmail', $eventDetails);
                      }
                      return;
                  }
              }
          }
          throw new \Exception('No email sender is capable of sending the email provided.');
      }
code: public function send(\BearFramework\Emails\Email $email): void
      {
          $app = App::get();
          $email = clone($email);
  
          if ($this->hasEventListeners('beforeSendEmail')) {
              $eventDetails = new \BearFramework\Emails\BeforeSendEmailEventDetails($email);
              $this->dispatchEvent('beforeSendEmail', $eventDetails);
              if ($eventDetails->preventDefault) {
                  return;
              }
          }
  
          if (empty($this->senders)) {
              throw new \Exception('No email senders added.');
          }
  
          foreach ($this->senders as $sender) {
              if (is_callable($sender)) {
                  $sender = call_user_func($sender);
              }
              if (is_string($sender)) {
                  $sender = new $sender();
              }
              if ($sender instanceof \BearFramework\Emails\ISender) {
                  if ($sender->send($email)) {
                      if ($this->hasEventListeners('sendEmail')) {
                          $eventDetails = new \BearFramework\Emails\SendEmailEventDetails($email);
                          $this->dispatchEvent('sendEmail', $eventDetails);
                      }
                      return;
                  }
              }
          }
          throw new \Exception('No email sender is capable of sending the email provided.');
      }
code_tokens: public function send ( \ BearFramework \ Emails \ Email $ email ) : void { $ app = App :: get ( ) ; $ email = clone ( $ email ) ; if ( $ this -> hasEventListeners ( 'beforeSendEmail' ) ) { $ eventDetails = new \ BearFramework \ Emails \ BeforeSendEmailEventDetails ( $ email ) ; $ this -> dispatchEvent ( 'beforeSendEmail' , $ eventDetails ) ; if ( $ eventDetails -> preventDefault ) { return ; } } if ( empty ( $ this -> senders ) ) { throw new \ Exception ( 'No email senders added.' ) ; } foreach ( $ this -> senders as $ sender ) { if ( is_callable ( $ sender ) ) { $ sender = call_user_func ( $ sender ) ; } if ( is_string ( $ sender ) ) { $ sender = new $ sender ( ) ; } if ( $ sender instanceof \ BearFramework \ Emails \ ISender ) { if ( $ sender -> send ( $ email ) ) { if ( $ this -> hasEventListeners ( 'sendEmail' ) ) { $ eventDetails = new \ BearFramework \ Emails \ SendEmailEventDetails ( $ email ) ; $ this -> dispatchEvent ( 'sendEmail' , $ eventDetails ) ; } return ; } } } throw new \ Exception ( 'No email sender is capable of sending the email provided.' ) ; }
docstring: Sends a email.
  
  @param \BearFramework\Emails\Email $email The email to send.
  @return void No value is returned.
  @throws \Exception
docstring_tokens: Sends a email .