Php Inspections (EA Extended): minor code tweaks (#579)
This commit is contained in:
parent
9fdcaabe3c
commit
e0ed25d6b2
|
@ -2395,10 +2395,10 @@ class Calculation
|
|||
|
||||
if (self::$functionReplaceToLocale === null) {
|
||||
self::$functionReplaceToLocale = [];
|
||||
foreach (array_values(self::$localeFunctions) as $localeFunctionName) {
|
||||
foreach (self::$localeFunctions as $localeFunctionName) {
|
||||
self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2';
|
||||
}
|
||||
foreach (array_values(self::$localeBoolean) as $localeBoolean) {
|
||||
foreach (self::$localeBoolean as $localeBoolean) {
|
||||
self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2';
|
||||
}
|
||||
}
|
||||
|
@ -2414,10 +2414,10 @@ class Calculation
|
|||
{
|
||||
if (self::$functionReplaceFromLocale === null) {
|
||||
self::$functionReplaceFromLocale = [];
|
||||
foreach (array_values(self::$localeFunctions) as $localeFunctionName) {
|
||||
foreach (self::$localeFunctions as $localeFunctionName) {
|
||||
self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/Ui';
|
||||
}
|
||||
foreach (array_values(self::$localeBoolean) as $excelBoolean) {
|
||||
foreach (self::$localeBoolean as $excelBoolean) {
|
||||
self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ class Functions
|
|||
return false;
|
||||
}
|
||||
|
||||
return in_array($value, array_values(self::$errorCodes));
|
||||
return in_array($value, self::$errorCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1090,7 +1090,7 @@ class MathTrig
|
|||
if ($cellReference->getWorksheet()->cellExists($column . $row)) {
|
||||
//take this cell out if it contains the SUBTOTAL formula
|
||||
$isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula();
|
||||
$cellFormula = !preg_match('/^=.*\bSUBTOTAL\s*\(/', strtoupper($cellReference->getWorksheet()->getCell($column . $row)->getValue()));
|
||||
$cellFormula = !preg_match('/^=.*\bSUBTOTAL\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue());
|
||||
|
||||
return !$isFormula || $cellFormula;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ class Xml extends BaseReader
|
|||
// Read sample data (first 2 KB will do)
|
||||
$data = fread($fileHandle, 2048);
|
||||
fclose($fileHandle);
|
||||
$data = strtr($data, "'", '"'); // fix headers with single quote
|
||||
$data = str_replace("'", '"', $data); // fix headers with single quote
|
||||
|
||||
$valid = true;
|
||||
foreach ($signature as $match) {
|
||||
|
|
Loading…
Reference in New Issue