original_string: public function getAddressesForType($type)
      {
          if (!isset($this->addresses[$type])) {
              throw new \Parable\Mail\Exception('Only to, cc, bcc addresses are allowed.');
          }
  
          $addresses = [];
          foreach ($this->addresses[$type] as $address) {
              if (!empty($address['name'])) {
                  $addresses[] = $address['name'] . ' <' . $address['email'] . '>';
              } else {
                  $addresses[] = $address['email'];
              }
          }
          return implode(', ', $addresses);
      }
code: public function getAddressesForType($type)
      {
          if (!isset($this->addresses[$type])) {
              throw new \Parable\Mail\Exception('Only to, cc, bcc addresses are allowed.');
          }
  
          $addresses = [];
          foreach ($this->addresses[$type] as $address) {
              if (!empty($address['name'])) {
                  $addresses[] = $address['name'] . ' <' . $address['email'] . '>';
              } else {
                  $addresses[] = $address['email'];
              }
          }
          return implode(', ', $addresses);
      }
code_tokens: public function getAddressesForType ( $ type ) { if ( ! isset ( $ this -> addresses [ $ type ] ) ) { throw new \ Parable \ Mail \ Exception ( 'Only to, cc, bcc addresses are allowed.' ) ; } $ addresses = [ ] ; foreach ( $ this -> addresses [ $ type ] as $ address ) { if ( ! empty ( $ address [ 'name' ] ) ) { $ addresses [ ] = $ address [ 'name' ] . ' <' . $ address [ 'email' ] . '>' ; } else { $ addresses [ ] = $ address [ 'email' ] ; } } return implode ( ', ' , $ addresses ) ; }
docstring: Return all addresses for type.
  
  @param string $type
  
  @return string
  @throws \Parable\Mail\Exception
docstring_tokens: Return all addresses for type .