Code Duplication    Length = 15-15 lines in 2 locations

system/vendor/swift/EasySwift.php 2 locations

@@ 228-242 (lines=15) @@
225
   * Clear out all message parts
226
   * @return boolean
227
   */
228
  public function flushParts()
229
  {
230
    $success = true;
231
    foreach ($this->partIds as $id)
232
    {
233
      try {
234
        $this->message->detach($id);
235
      } catch (Swift_Message_MimeException $e) {
236
        $success = false;
237
        $this->setError("A MIME part failed to detach due to the error:<br />" . $e->getMessage());
238
      }
239
    }
240
    $this->partIds = array();
241
    return $success;
242
  }
243
  /**
244
   * Clear out all attachments
245
   * @return boolean
@@ 247-261 (lines=15) @@
244
   * Clear out all attachments
245
   * @return boolean
246
   */
247
  public function flushAttachments()
248
  {
249
    $success = true;
250
    foreach ($this->attachmentIds as $id)
251
    {
252
      try {
253
        $this->message->detach($id);
254
      } catch (Swift_Message_MimeException $e) {
255
        $success = false;
256
        $this->setError("An attachment failed to detach due to the error:<br />" . $e->getMessage());
257
      }
258
    }
259
    $this->attachmentIds = array();
260
    return $success;
261
  }
262
  /**
263
   * Clear out all message headers
264
   * @deprecated