Code Duplication    Length = 18-18 lines in 3 locations

app/Functions/Functions.php 3 locations

@@ 711-728 (lines=18) @@
708
				return I18N::translate('father');
709
			case 'par':
710
				return I18N::translate('parent');
711
			case 'hus':
712
				if ($person1 && $person2) {
713
					foreach ($person1->getSpouseFamilies() as $family) {
714
						if ($person2 === $family->getSpouse($person1)) {
715
							if ($family->getFacts('_NMR')) {
716
								if ($family->getFacts(WT_EVENTS_DIV)) {
717
									return I18N::translateContext('MALE', 'ex-partner');
718
								} else {
719
									return I18N::translateContext('MALE', 'partner');
720
								}
721
							} elseif ($family->getFacts(WT_EVENTS_DIV)) {
722
								return I18N::translate('ex-husband');
723
							}
724
						}
725
					}
726
				}
727
728
				return I18N::translate('husband');
729
			case 'wif':
730
				if ($person1 && $person1) {
731
					foreach ($person1->getSpouseFamilies() as $family) {
@@ 729-746 (lines=18) @@
726
				}
727
728
				return I18N::translate('husband');
729
			case 'wif':
730
				if ($person1 && $person1) {
731
					foreach ($person1->getSpouseFamilies() as $family) {
732
						if ($person2 === $family->getSpouse($person1)) {
733
							if ($family->getFacts('_NMR')) {
734
								if ($family->getFacts(WT_EVENTS_DIV)) {
735
									return I18N::translateContext('FEMALE', 'ex-partner');
736
								} else {
737
									return I18N::translateContext('FEMALE', 'partner');
738
								}
739
							} elseif ($family->getFacts(WT_EVENTS_DIV)) {
740
								return I18N::translate('ex-wife');
741
							}
742
						}
743
					}
744
				}
745
746
				return I18N::translate('wife');
747
			case 'spo':
748
				if ($person1 && $person2) {
749
					foreach ($person1->getSpouseFamilies() as $family) {
@@ 747-764 (lines=18) @@
744
				}
745
746
				return I18N::translate('wife');
747
			case 'spo':
748
				if ($person1 && $person2) {
749
					foreach ($person1->getSpouseFamilies() as $family) {
750
						if ($person2 === $family->getSpouse($person1)) {
751
							if ($family->getFacts('_NMR')) {
752
								if ($family->getFacts(WT_EVENTS_DIV)) {
753
									return I18N::translateContext('MALE/FEMALE', 'ex-partner');
754
								} else {
755
									return I18N::translateContext('MALE/FEMALE', 'partner');
756
								}
757
							} elseif ($family->getFacts(WT_EVENTS_DIV)) {
758
								return I18N::translate('ex-spouse');
759
							}
760
						}
761
					}
762
				}
763
764
				return I18N::translate('spouse');
765
			case 'son':
766
				return I18N::translate('son');
767
			case 'dau':