original_string: private function buildDestinations($destinations) 
      {
          $ret = array();
          foreach ($destinations as $dest) 
          {
              $d = [
                  "Destination" => $this->buildDestination($dest["dest"]),
                  "ReplacementTemplateData" => $this->buildReplacements($dest["data"])
              ];
              if (isset($dest["tags"]) && $dest["tags"])
                  $d['ReplacementTags'] = $this->buildTags($dest["tags"]);
              $ret[] = $d;
          } 
          return $ret;
      }
code: private function buildDestinations($destinations) 
      {
          $ret = array();
          foreach ($destinations as $dest) 
          {
              $d = [
                  "Destination" => $this->buildDestination($dest["dest"]),
                  "ReplacementTemplateData" => $this->buildReplacements($dest["data"])
              ];
              if (isset($dest["tags"]) && $dest["tags"])
                  $d['ReplacementTags'] = $this->buildTags($dest["tags"]);
              $ret[] = $d;
          } 
          return $ret;
      }
code_tokens: private function buildDestinations ( $ destinations ) { $ ret = array ( ) ; foreach ( $ destinations as $ dest ) { $ d = [ "Destination" => $ this -> buildDestination ( $ dest [ "dest" ] ) , "ReplacementTemplateData" => $ this -> buildReplacements ( $ dest [ "data" ] ) ] ; if ( isset ( $ dest [ "tags" ] ) && $ dest [ "tags" ] ) $ d [ 'ReplacementTags' ] = $ this -> buildTags ( $ dest [ "tags" ] ) ; $ ret [ ] = $ d ; } return $ ret ; }
docstring: Create an array of destinations for bulk mail send
  
  @param array $destinations in the required format
  <pre>
  [
  "dest"   => destination emails (array ['to' => [...], 'cc' => [...], 'bcc' => [...]])
  "data"   => replacement data (array)
  "tags"   => tags (array [name1 => value1, ...])
  ],
  ...
  </pre>
  @return array
docstring_tokens: Create an array of destinations for bulk mail send