Code Duplication    Length = 3-5 lines in 3 locations

app/Functions/FunctionsEdit.php 2 locations

@@ 1083-1085 (lines=3) @@
1080
1081
		$tags = ['NPFX', 'GIVN', 'SPFX', 'SURN', 'NSFX'];
1082
1083
		if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $WT_TREE->getPreference('ADVANCED_NAME_FACTS'), $match)) {
1084
			$tags = array_merge($tags, $match[1]);
1085
		}
1086
1087
		// Paternal and Polish and Lithuanian surname traditions can also create a _MARNM
1088
		$SURNAME_TRADITION = $WT_TREE->getPreference('SURNAME_TRADITION');
@@ 1507-1509 (lines=3) @@
1504
		if (in_array($level1type, Config::dateAndTime())) {
1505
			$expected_subtags['DATE'] = ['TIME']; // TIME is NOT a valid 5.5.1 tag
1506
		}
1507
		if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $record->getTree()->getPreference('ADVANCED_PLAC_FACTS'), $match)) {
1508
			$expected_subtags['PLAC'] = array_merge($match[1], $expected_subtags['PLAC']);
1509
		}
1510
1511
		$stack = [];
1512
		// Loop on existing tags :

edit_interface.php 1 location

@@ 3054-3058 (lines=5) @@
3051
		//-- if adding a spouse add the option to add a marriage fact to the new family
3052
		if ($nextaction === 'add_spouse_to_individual_action' || $nextaction === 'add_spouse_to_family_action') {
3053
			$bdm .= 'M';
3054
			if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $controller->tree()->getPreference('QUICK_REQUIRED_FAMFACTS'), $matches)) {
3055
				foreach ($matches[1] as $match) {
3056
					echo FunctionsEdit::addSimpleTags($match);
3057
				}
3058
			}
3059
		}
3060
		if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
3061
			foreach ($matches[1] as $match) {