Code Duplication    Length = 18-18 lines in 3 locations

app/Functions/Functions.php 3 locations

@@ 692-709 (lines=18) @@
689
			return I18N::translate('father');
690
		case 'par':
691
			return I18N::translate('parent');
692
		case 'hus':
693
			if ($person1 && $person2) {
694
				foreach ($person1->getSpouseFamilies() as $family) {
695
					if ($person2 === $family->getSpouse($person1)) {
696
						if ($family->getFacts('_NMR')) {
697
							if ($family->getFacts(WT_EVENTS_DIV)) {
698
								return I18N::translateContext('MALE', 'ex-partner');
699
							} else {
700
								return I18N::translateContext('MALE', 'partner');
701
							}
702
						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
703
							return I18N::translate('ex-husband');
704
						}
705
					}
706
				}
707
			}
708
709
			return I18N::translate('husband');
710
		case 'wif':
711
			if ($person1 && $person2) {
712
				foreach ($person1->getSpouseFamilies() as $family) {
@@ 710-727 (lines=18) @@
707
			}
708
709
			return I18N::translate('husband');
710
		case 'wif':
711
			if ($person1 && $person2) {
712
				foreach ($person1->getSpouseFamilies() as $family) {
713
					if ($person2 === $family->getSpouse($person1)) {
714
						if ($family->getFacts('_NMR')) {
715
							if ($family->getFacts(WT_EVENTS_DIV)) {
716
								return I18N::translateContext('FEMALE', 'ex-partner');
717
							} else {
718
								return I18N::translateContext('FEMALE', 'partner');
719
							}
720
						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
721
							return I18N::translate('ex-wife');
722
						}
723
					}
724
				}
725
			}
726
727
			return I18N::translate('wife');
728
		case 'spo':
729
			if ($person1 && $person2) {
730
				foreach ($person1->getSpouseFamilies() as $family) {
@@ 728-745 (lines=18) @@
725
			}
726
727
			return I18N::translate('wife');
728
		case 'spo':
729
			if ($person1 && $person2) {
730
				foreach ($person1->getSpouseFamilies() as $family) {
731
					if ($person2 === $family->getSpouse($person1)) {
732
						if ($family->getFacts('_NMR')) {
733
							if ($family->getFacts(WT_EVENTS_DIV)) {
734
								return I18N::translate('ex-partner');
735
							} else {
736
								return I18N::translate('partner');
737
							}
738
						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
739
							return I18N::translate('ex-spouse');
740
						}
741
					}
742
				}
743
			}
744
745
			return I18N::translate('spouse');
746
		case 'son':
747
			return I18N::translate('son');
748
		case 'dau':