original_string: public static function deliver($to = null, $subject = null, $message = null, $config = 'default', $send = true)
      {
          $class = __CLASS__;
  
          if (is_array($config) && !isset($config['transport'])) {
              $config['transport'] = 'default';
          }
          /* @var \Cake\Mailer\Email $instance */
          $instance = new $class($config);
          if ($to !== null) {
              $instance->setTo($to);
          }
          if ($subject !== null) {
              $instance->setSubject($subject);
          }
          if (is_array($message)) {
              $instance->setViewVars($message);
              $message = null;
          } elseif ($message === null && array_key_exists('message', $config = $instance->getProfile())) {
              $message = $config['message'];
          }
  
          if ($send === true) {
              $instance->send($message);
          }
  
          return $instance;
      }
code: public static function deliver($to = null, $subject = null, $message = null, $config = 'default', $send = true)
      {
          $class = __CLASS__;
  
          if (is_array($config) && !isset($config['transport'])) {
              $config['transport'] = 'default';
          }
          /* @var \Cake\Mailer\Email $instance */
          $instance = new $class($config);
          if ($to !== null) {
              $instance->setTo($to);
          }
          if ($subject !== null) {
              $instance->setSubject($subject);
          }
          if (is_array($message)) {
              $instance->setViewVars($message);
              $message = null;
          } elseif ($message === null && array_key_exists('message', $config = $instance->getProfile())) {
              $message = $config['message'];
          }
  
          if ($send === true) {
              $instance->send($message);
          }
  
          return $instance;
      }
code_tokens: public static function deliver ( $ to = null , $ subject = null , $ message = null , $ config = 'default' , $ send = true ) { $ class = __CLASS__ ; if ( is_array ( $ config ) && ! isset ( $ config [ 'transport' ] ) ) { $ config [ 'transport' ] = 'default' ; } /* @var \Cake\Mailer\Email $instance */ $ instance = new $ class ( $ config ) ; if ( $ to !== null ) { $ instance -> setTo ( $ to ) ; } if ( $ subject !== null ) { $ instance -> setSubject ( $ subject ) ; } if ( is_array ( $ message ) ) { $ instance -> setViewVars ( $ message ) ; $ message = null ; } elseif ( $ message === null && array_key_exists ( 'message' , $ config = $ instance -> getProfile ( ) ) ) { $ message = $ config [ 'message' ] ; } if ( $ send === true ) { $ instance -> send ( $ message ) ; } return $ instance ; }
docstring: Static method to fast create an instance of \Cake\Mailer\Email
  
  @param string|array|null $to Address to send (see Cake\Mailer\Email::to()). If null, will try to use 'to' from transport config
  @param string|null $subject String of subject or null to use 'subject' from transport config
  @param string|array|null $message String with message or array with variables to be used in render
  @param string|array $config String to use Email delivery profile from app.php or array with configs
  @param bool $send Send the email or just return the instance pre-configured
  @return static Instance of Cake\Mailer\Email
  @throws \InvalidArgumentException
docstring_tokens: Static method to fast create an instance of \ Cake \ Mailer \ Email