original_string: public function jsonSerialize()
      {
          $properties = [
              '_to', '_from', '_sender', '_replyTo', '_cc', '_bcc', '_subject',
              '_returnPath', '_readReceipt', '_emailFormat', '_emailPattern', '_domain',
              '_attachments', '_messageId', '_headers', '_appCharset', 'viewVars', 'charset', 'headerCharset'
          ];
  
          $array = ['viewConfig' => $this->viewBuilder()->jsonSerialize()];
  
          foreach ($properties as $property) {
              $array[$property] = $this->{$property};
          }
  
          array_walk($array['_attachments'], function (&$item, $key) {
              if (!empty($item['file'])) {
                  $item['data'] = $this->_readFile($item['file']);
                  unset($item['file']);
              }
          });
  
          array_walk_recursive($array['viewVars'], [$this, '_checkViewVars']);
  
          return array_filter($array, function ($i) {
              return !is_array($i) && strlen($i) || !empty($i);
          });
      }
code: public function jsonSerialize()
      {
          $properties = [
              '_to', '_from', '_sender', '_replyTo', '_cc', '_bcc', '_subject',
              '_returnPath', '_readReceipt', '_emailFormat', '_emailPattern', '_domain',
              '_attachments', '_messageId', '_headers', '_appCharset', 'viewVars', 'charset', 'headerCharset'
          ];
  
          $array = ['viewConfig' => $this->viewBuilder()->jsonSerialize()];
  
          foreach ($properties as $property) {
              $array[$property] = $this->{$property};
          }
  
          array_walk($array['_attachments'], function (&$item, $key) {
              if (!empty($item['file'])) {
                  $item['data'] = $this->_readFile($item['file']);
                  unset($item['file']);
              }
          });
  
          array_walk_recursive($array['viewVars'], [$this, '_checkViewVars']);
  
          return array_filter($array, function ($i) {
              return !is_array($i) && strlen($i) || !empty($i);
          });
      }
code_tokens: public function jsonSerialize ( ) { $ properties = [ '_to' , '_from' , '_sender' , '_replyTo' , '_cc' , '_bcc' , '_subject' , '_returnPath' , '_readReceipt' , '_emailFormat' , '_emailPattern' , '_domain' , '_attachments' , '_messageId' , '_headers' , '_appCharset' , 'viewVars' , 'charset' , 'headerCharset' ] ; $ array = [ 'viewConfig' => $ this -> viewBuilder ( ) -> jsonSerialize ( ) ] ; foreach ( $ properties as $ property ) { $ array [ $ property ] = $ this -> { $ property } ; } array_walk ( $ array [ '_attachments' ] , function ( & $ item , $ key ) { if ( ! empty ( $ item [ 'file' ] ) ) { $ item [ 'data' ] = $ this -> _readFile ( $ item [ 'file' ] ) ; unset ( $ item [ 'file' ] ) ; } } ) ; array_walk_recursive ( $ array [ 'viewVars' ] , [ $ this , '_checkViewVars' ] ) ; return array_filter ( $ array , function ( $ i ) { return ! is_array ( $ i ) && strlen ( $ i ) || ! empty ( $ i ) ; } ) ; }
docstring: Serializes the email object to a value that can be natively serialized and re-used
  to clone this email instance.
  
  It has certain limitations for viewVars that are good to know:
  
  - ORM\Query executed and stored as resultset
  - SimpleXMLElements stored as associative array
  - Exceptions stored as strings
  - Resources, \Closure and \PDO are not supported.
  
  @return array Serializable array of configuration properties.
  @throws \Exception When a view var object can not be properly serialized.
docstring_tokens: Serializes the email object to a value that can be natively serialized and re - used to clone this email instance .