Code Duplication    Length = 6-7 lines in 3 locations

app/Functions/FunctionsRtl.php 3 locations

@@ 202-208 (lines=7) @@
199
							if (strpos(self::NUMBERS, $charArray['letter']) === false) {
200
								// This is not a digit. End the run of digits and punctuation.
201
								$numberState = false;
202
								if (self::$currentState == 'RTL') {
203
									if (strpos(self::NUMBER_PREFIX, $currentLetter) === false) {
204
										$currentLetter = WT_UTF8_PDF . $currentLetter;
205
									} else {
206
										$currentLetter = $currentLetter . WT_UTF8_PDF; // Include a trailing + or - in the run
207
									}
208
								}
209
							}
210
						}
211
					} else {
@@ 217-222 (lines=6) @@
214
							// This might be a number lead-in
215
							$offset   = $currentLen;
216
							$nextChar = substr($workingText . "\n", $offset, 1);
217
							if (strpos(self::NUMBERS, $nextChar) !== false) {
218
								$numberState = true; // We found a digit: the lead-in is therefore numeric
219
								if (self::$currentState == 'RTL') {
220
									$currentLetter = WT_UTF8_LRE . $currentLetter;
221
								}
222
							}
223
						} elseif (strpos(self::NUMBERS, $currentLetter) !== false) {
224
							$numberState = true; // The current letter is a digit
225
							if (self::$currentState == 'RTL') {
@@ 223-228 (lines=6) @@
220
									$currentLetter = WT_UTF8_LRE . $currentLetter;
221
								}
222
							}
223
						} elseif (strpos(self::NUMBERS, $currentLetter) !== false) {
224
							$numberState = true; // The current letter is a digit
225
							if (self::$currentState == 'RTL') {
226
								$currentLetter = WT_UTF8_LRE . $currentLetter;
227
							}
228
						}
229
					}
230
231
					// Determine the directionality of the current UTF-8 character