Code Duplication    Length = 13-15 lines in 2 locations

lib/private/Mail/EMailTemplate.php 2 locations

@@ 381-393 (lines=13) @@
378
	 * @param string|bool $plainTitle Title that is used in the plain text email
379
	 *   if empty the $title is used, if false none will be used
380
	 */
381
	public function addHeading($title, $plainTitle = '') {
382
		if ($this->footerAdded) {
383
			return;
384
		}
385
		if ($plainTitle === '') {
386
			$plainTitle = $title;
387
		}
388
389
		$this->htmlBody .= vsprintf($this->heading, [htmlspecialchars($title)]);
390
		if ($plainTitle !== false) {
391
			$this->plainBody .= $plainTitle . PHP_EOL . PHP_EOL;
392
		}
393
	}
394
395
	/**
396
	 * Open the HTML body when it is not already
@@ 414-428 (lines=15) @@
411
	 * @param string|bool $plainText Text that is used in the plain text email
412
	 *   if empty the $text is used, if false none will be used
413
	 */
414
	public function addBodyText($text, $plainText = '') {
415
		if ($this->footerAdded) {
416
			return;
417
		}
418
		if ($plainText === '') {
419
			$plainText = $text;
420
		}
421
422
		$this->ensureBodyIsOpened();
423
424
		$this->htmlBody .= vsprintf($this->bodyText, [htmlspecialchars($text)]);
425
		if ($plainText !== false) {
426
			$this->plainBody .= $plainText . PHP_EOL . PHP_EOL;
427
		}
428
	}
429
430
	/**
431
	 * Adds a list item to the body of the email