Code Duplication    Length = 23-24 lines in 2 locations

app/Vendor/PHPExcel/PHPExcel/Calculation.php 2 locations

@@ 2002-2025 (lines=24) @@
1999
	private static $functionReplaceFromExcel	= null;
2000
	private static $functionReplaceToLocale		= null;
2001
2002
	public function _translateFormulaToLocale($formula) {
2003
		if (self::$functionReplaceFromExcel === NULL) {
2004
			self::$functionReplaceFromExcel = array();
2005
			foreach(array_keys(self::$_localeFunctions) as $excelFunctionName) {
2006
				self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui';
2007
			}
2008
			foreach(array_keys(self::$_localeBoolean) as $excelBoolean) {
2009
				self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
2010
			}
2011
2012
		}
2013
2014
		if (self::$functionReplaceToLocale === NULL) {
2015
			self::$functionReplaceToLocale = array();
2016
			foreach(array_values(self::$_localeFunctions) as $localeFunctionName) {
2017
				self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2';
2018
			}
2019
			foreach(array_values(self::$_localeBoolean) as $localeBoolean) {
2020
				self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2';
2021
			}
2022
		}
2023
2024
		return self::_translateFormula(self::$functionReplaceFromExcel,self::$functionReplaceToLocale,$formula,',',self::$_localeArgumentSeparator);
2025
	}	//	function _translateFormulaToLocale()
2026
2027
2028
	private static $functionReplaceFromLocale	= null;
@@ 2031-2053 (lines=23) @@
2028
	private static $functionReplaceFromLocale	= null;
2029
	private static $functionReplaceToExcel		= null;
2030
2031
	public function _translateFormulaToEnglish($formula) {
2032
		if (self::$functionReplaceFromLocale === NULL) {
2033
			self::$functionReplaceFromLocale = array();
2034
			foreach(array_values(self::$_localeFunctions) as $localeFunctionName) {
2035
				self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui';
2036
			}
2037
			foreach(array_values(self::$_localeBoolean) as $excelBoolean) {
2038
				self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
2039
			}
2040
		}
2041
2042
		if (self::$functionReplaceToExcel === NULL) {
2043
			self::$functionReplaceToExcel = array();
2044
			foreach(array_keys(self::$_localeFunctions) as $excelFunctionName) {
2045
				self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2';
2046
			}
2047
			foreach(array_keys(self::$_localeBoolean) as $excelBoolean) {
2048
				self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2';
2049
			}
2050
		}
2051
2052
		return self::_translateFormula(self::$functionReplaceFromLocale,self::$functionReplaceToExcel,$formula,self::$_localeArgumentSeparator,',');
2053
	}	//	function _translateFormulaToEnglish()
2054
2055
2056
	public static function _localeFunc($function) {