original_string: private function emailsToString($emails) {
  
  		$format = [];
  
  		foreach($emails as $email) {
  
  			if(true === isset($email -> name) && trim($email -> name) !== '') {
  				$format[] = sprintf('"%s" <%s>', $email -> name, filter_var($email -> email, FILTER_SANITIZE_EMAIL));
  			}
  			else {
  				$format[] = filter_var($email -> email, FILTER_SANITIZE_EMAIL);
  			}
  		}
  
  		$emails = implode($format, ',');
  
  		return ('' !== trim($emails)) ? $emails : null;
  	}
code: private function emailsToString($emails) {
  
  		$format = [];
  
  		foreach($emails as $email) {
  
  			if(true === isset($email -> name) && trim($email -> name) !== '') {
  				$format[] = sprintf('"%s" <%s>', $email -> name, filter_var($email -> email, FILTER_SANITIZE_EMAIL));
  			}
  			else {
  				$format[] = filter_var($email -> email, FILTER_SANITIZE_EMAIL);
  			}
  		}
  
  		$emails = implode($format, ',');
  
  		return ('' !== trim($emails)) ? $emails : null;
  	}
code_tokens: private function emailsToString ( $ emails ) { $ format = [ ] ; foreach ( $ emails as $ email ) { if ( true === isset ( $ email -> name ) && trim ( $ email -> name ) !== '' ) { $ format [ ] = sprintf ( '"%s" <%s>' , $ email -> name , filter_var ( $ email -> email , FILTER_SANITIZE_EMAIL ) ) ; } else { $ format [ ] = filter_var ( $ email -> email , FILTER_SANITIZE_EMAIL ) ; } } $ emails = implode ( $ format , ',' ) ; return ( '' !== trim ( $ emails ) ) ? $ emails : null ; }
docstring: Formats an array with emails to string
  @param array $emails
  @return null|string
docstring_tokens: Formats an array with emails to string