@@ -291,15 +291,15 @@ |
||
291 | 291 | public function getHashCode() |
292 | 292 | { |
293 | 293 | return md5( |
294 | - $this->author . |
|
295 | - $this->text->getHashCode() . |
|
296 | - $this->width . |
|
297 | - $this->height . |
|
298 | - $this->marginLeft . |
|
299 | - $this->marginTop . |
|
300 | - ($this->visible ? 1 : 0) . |
|
301 | - $this->fillColor->getHashCode() . |
|
302 | - $this->alignment . |
|
294 | + $this->author. |
|
295 | + $this->text->getHashCode(). |
|
296 | + $this->width. |
|
297 | + $this->height. |
|
298 | + $this->marginLeft. |
|
299 | + $this->marginTop. |
|
300 | + ($this->visible ? 1 : 0). |
|
301 | + $this->fillColor->getHashCode(). |
|
302 | + $this->alignment. |
|
303 | 303 | __CLASS__ |
304 | 304 | ); |
305 | 305 | } |
@@ -2260,8 +2260,8 @@ discard block |
||
2260 | 2260 | |
2261 | 2261 | private static function loadLocales() |
2262 | 2262 | { |
2263 | - $localeFileDirectory = __DIR__ . '/locale/'; |
|
2264 | - foreach (glob($localeFileDirectory . '*', GLOB_ONLYDIR) as $filename) { |
|
2263 | + $localeFileDirectory = __DIR__.'/locale/'; |
|
2264 | + foreach (glob($localeFileDirectory.'*', GLOB_ONLYDIR) as $filename) { |
|
2265 | 2265 | $filename = substr($filename, strlen($localeFileDirectory)); |
2266 | 2266 | if ($filename != 'en') { |
2267 | 2267 | self::$validLocaleLanguages[] = $filename; |
@@ -2506,10 +2506,10 @@ discard block |
||
2506 | 2506 | // Default is English, if user isn't requesting english, then read the necessary data from the locale files |
2507 | 2507 | if ($locale != 'en_us') { |
2508 | 2508 | // Search for a file with a list of function names for locale |
2509 | - $functionNamesFile = __DIR__ . '/locale/' . str_replace('_', DIRECTORY_SEPARATOR, $locale) . DIRECTORY_SEPARATOR . 'functions'; |
|
2509 | + $functionNamesFile = __DIR__.'/locale/'.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'functions'; |
|
2510 | 2510 | if (!file_exists($functionNamesFile)) { |
2511 | 2511 | // If there isn't a locale specific function file, look for a language specific function file |
2512 | - $functionNamesFile = __DIR__ . '/locale/' . $language . DIRECTORY_SEPARATOR . 'functions'; |
|
2512 | + $functionNamesFile = __DIR__.'/locale/'.$language.DIRECTORY_SEPARATOR.'functions'; |
|
2513 | 2513 | if (!file_exists($functionNamesFile)) { |
2514 | 2514 | return false; |
2515 | 2515 | } |
@@ -2535,9 +2535,9 @@ discard block |
||
2535 | 2535 | self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE']; |
2536 | 2536 | } |
2537 | 2537 | |
2538 | - $configFile = __DIR__ . '/locale/' . str_replace('_', DIRECTORY_SEPARATOR, $locale) . DIRECTORY_SEPARATOR . 'config'; |
|
2538 | + $configFile = __DIR__.'/locale/'.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'config'; |
|
2539 | 2539 | if (!file_exists($configFile)) { |
2540 | - $configFile = __DIR__ . '/locale/' . $language . DIRECTORY_SEPARATOR . 'config'; |
|
2540 | + $configFile = __DIR__.'/locale/'.$language.DIRECTORY_SEPARATOR.'config'; |
|
2541 | 2541 | } |
2542 | 2542 | if (file_exists($configFile)) { |
2543 | 2543 | $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
@@ -2591,7 +2591,7 @@ discard block |
||
2591 | 2591 | break; |
2592 | 2592 | case $fromSeparator: |
2593 | 2593 | if (!$inBraces) { |
2594 | - $formula = mb_substr($formula, 0, $i) . $toSeparator . mb_substr($formula, $i + 1); |
|
2594 | + $formula = mb_substr($formula, 0, $i).$toSeparator.mb_substr($formula, $i + 1); |
|
2595 | 2595 | } |
2596 | 2596 | } |
2597 | 2597 | } |
@@ -2648,20 +2648,20 @@ discard block |
||
2648 | 2648 | if (self::$functionReplaceFromExcel === null) { |
2649 | 2649 | self::$functionReplaceFromExcel = []; |
2650 | 2650 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
2651 | - self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName, '/') . '([\s]*\()/Ui'; |
|
2651 | + self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName, '/').'([\s]*\()/Ui'; |
|
2652 | 2652 | } |
2653 | 2653 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
2654 | - self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui'; |
|
2654 | + self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean, '/').'([^\w\.])/Ui'; |
|
2655 | 2655 | } |
2656 | 2656 | } |
2657 | 2657 | |
2658 | 2658 | if (self::$functionReplaceToLocale === null) { |
2659 | 2659 | self::$functionReplaceToLocale = []; |
2660 | 2660 | foreach (self::$localeFunctions as $localeFunctionName) { |
2661 | - self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2'; |
|
2661 | + self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2'; |
|
2662 | 2662 | } |
2663 | 2663 | foreach (self::$localeBoolean as $localeBoolean) { |
2664 | - self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2'; |
|
2664 | + self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2'; |
|
2665 | 2665 | } |
2666 | 2666 | } |
2667 | 2667 | |
@@ -2677,20 +2677,20 @@ discard block |
||
2677 | 2677 | if (self::$functionReplaceFromLocale === null) { |
2678 | 2678 | self::$functionReplaceFromLocale = []; |
2679 | 2679 | foreach (self::$localeFunctions as $localeFunctionName) { |
2680 | - self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/Ui'; |
|
2680 | + self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName, '/').'([\s]*\()/Ui'; |
|
2681 | 2681 | } |
2682 | 2682 | foreach (self::$localeBoolean as $excelBoolean) { |
2683 | - self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui'; |
|
2683 | + self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean, '/').'([^\w\.])/Ui'; |
|
2684 | 2684 | } |
2685 | 2685 | } |
2686 | 2686 | |
2687 | 2687 | if (self::$functionReplaceToExcel === null) { |
2688 | 2688 | self::$functionReplaceToExcel = []; |
2689 | 2689 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
2690 | - self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2'; |
|
2690 | + self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2'; |
|
2691 | 2691 | } |
2692 | 2692 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
2693 | - self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2'; |
|
2693 | + self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2'; |
|
2694 | 2694 | } |
2695 | 2695 | } |
2696 | 2696 | |
@@ -2724,12 +2724,12 @@ discard block |
||
2724 | 2724 | { |
2725 | 2725 | if (is_string($value)) { |
2726 | 2726 | // Error values cannot be "wrapped" |
2727 | - if (preg_match('/^' . self::CALCULATION_REGEXP_ERROR . '$/i', $value, $match)) { |
|
2727 | + if (preg_match('/^'.self::CALCULATION_REGEXP_ERROR.'$/i', $value, $match)) { |
|
2728 | 2728 | // Return Excel errors "as is" |
2729 | 2729 | return $value; |
2730 | 2730 | } |
2731 | 2731 | // Return strings wrapped in quotes |
2732 | - return '"' . $value . '"'; |
|
2732 | + return '"'.$value.'"'; |
|
2733 | 2733 | // Convert numeric errors to NaN error |
2734 | 2734 | } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { |
2735 | 2735 | return Functions::NAN(); |
@@ -2995,7 +2995,7 @@ discard block |
||
2995 | 2995 | |
2996 | 2996 | $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; |
2997 | 2997 | $wsTitle = ($pCellParent !== null) ? $pCellParent->getTitle() : "\x00Wrk"; |
2998 | - $wsCellReference = $wsTitle . '!' . $cellID; |
|
2998 | + $wsCellReference = $wsTitle.'!'.$cellID; |
|
2999 | 2999 | |
3000 | 3000 | if (($cellID !== null) && ($this->getValueFromCache($wsCellReference, $cellValue))) { |
3001 | 3001 | return $cellValue; |
@@ -3222,9 +3222,9 @@ discard block |
||
3222 | 3222 | } |
3223 | 3223 | } |
3224 | 3224 | |
3225 | - return '{ ' . implode($rpad, $returnMatrix) . ' }'; |
|
3225 | + return '{ '.implode($rpad, $returnMatrix).' }'; |
|
3226 | 3226 | } elseif (is_string($value) && (trim($value, '"') == $value)) { |
3227 | - return '"' . $value . '"'; |
|
3227 | + return '"'.$value.'"'; |
|
3228 | 3228 | } elseif (is_bool($value)) { |
3229 | 3229 | return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE']; |
3230 | 3230 | } |
@@ -3262,12 +3262,12 @@ discard block |
||
3262 | 3262 | if ($value == '') { |
3263 | 3263 | return 'an empty string'; |
3264 | 3264 | } elseif ($value[0] == '#') { |
3265 | - return 'a ' . $value . ' error'; |
|
3265 | + return 'a '.$value.' error'; |
|
3266 | 3266 | } |
3267 | 3267 | $typeString = 'a string'; |
3268 | 3268 | } |
3269 | 3269 | |
3270 | - return $typeString . ' with a value of ' . $this->showValue($value); |
|
3270 | + return $typeString.' with a value of '.$this->showValue($value); |
|
3271 | 3271 | } |
3272 | 3272 | } |
3273 | 3273 | |
@@ -3381,13 +3381,13 @@ discard block |
||
3381 | 3381 | // so we store the parent worksheet so that we can re-attach it when necessary |
3382 | 3382 | $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; |
3383 | 3383 | |
3384 | - $regexpMatchString = '/^(' . self::CALCULATION_REGEXP_FUNCTION . |
|
3385 | - '|' . self::CALCULATION_REGEXP_CELLREF . |
|
3386 | - '|' . self::CALCULATION_REGEXP_NUMBER . |
|
3387 | - '|' . self::CALCULATION_REGEXP_STRING . |
|
3388 | - '|' . self::CALCULATION_REGEXP_OPENBRACE . |
|
3389 | - '|' . self::CALCULATION_REGEXP_NAMEDRANGE . |
|
3390 | - '|' . self::CALCULATION_REGEXP_ERROR . |
|
3384 | + $regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION. |
|
3385 | + '|'.self::CALCULATION_REGEXP_CELLREF. |
|
3386 | + '|'.self::CALCULATION_REGEXP_NUMBER. |
|
3387 | + '|'.self::CALCULATION_REGEXP_STRING. |
|
3388 | + '|'.self::CALCULATION_REGEXP_OPENBRACE. |
|
3389 | + '|'.self::CALCULATION_REGEXP_NAMEDRANGE. |
|
3390 | + '|'.self::CALCULATION_REGEXP_ERROR. |
|
3391 | 3391 | ')/si'; |
3392 | 3392 | |
3393 | 3393 | // Start with initialisation |
@@ -3494,7 +3494,7 @@ discard block |
||
3494 | 3494 | $parenthesisDepthMap[$pendingStoreKey] -= 1; |
3495 | 3495 | } |
3496 | 3496 | |
3497 | - if (is_array($d) && preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { // Did this parenthesis just close a function? |
|
3497 | + if (is_array($d) && preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function? |
|
3498 | 3498 | if (!empty($pendingStoreKey) && $parenthesisDepthMap[$pendingStoreKey] == -1) { |
3499 | 3499 | // we are closing an IF( |
3500 | 3500 | if ($d['value'] != 'IF(') { |
@@ -3530,7 +3530,7 @@ discard block |
||
3530 | 3530 | if ($expectedArgumentCount < 0) { |
3531 | 3531 | if ($argumentCount > abs($expectedArgumentCount)) { |
3532 | 3532 | $argumentCountError = true; |
3533 | - $expectedArgumentCountString = 'no more than ' . abs($expectedArgumentCount); |
|
3533 | + $expectedArgumentCountString = 'no more than '.abs($expectedArgumentCount); |
|
3534 | 3534 | } |
3535 | 3535 | } else { |
3536 | 3536 | if ($argumentCount != $expectedArgumentCount) { |
@@ -3544,28 +3544,28 @@ discard block |
||
3544 | 3544 | case '+': |
3545 | 3545 | if ($argumentCount < $argMatch[1]) { |
3546 | 3546 | $argumentCountError = true; |
3547 | - $expectedArgumentCountString = $argMatch[1] . ' or more '; |
|
3547 | + $expectedArgumentCountString = $argMatch[1].' or more '; |
|
3548 | 3548 | } |
3549 | 3549 | |
3550 | 3550 | break; |
3551 | 3551 | case '-': |
3552 | 3552 | if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) { |
3553 | 3553 | $argumentCountError = true; |
3554 | - $expectedArgumentCountString = 'between ' . $argMatch[1] . ' and ' . $argMatch[3]; |
|
3554 | + $expectedArgumentCountString = 'between '.$argMatch[1].' and '.$argMatch[3]; |
|
3555 | 3555 | } |
3556 | 3556 | |
3557 | 3557 | break; |
3558 | 3558 | case ',': |
3559 | 3559 | if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) { |
3560 | 3560 | $argumentCountError = true; |
3561 | - $expectedArgumentCountString = 'either ' . $argMatch[1] . ' or ' . $argMatch[3]; |
|
3561 | + $expectedArgumentCountString = 'either '.$argMatch[1].' or '.$argMatch[3]; |
|
3562 | 3562 | } |
3563 | 3563 | |
3564 | 3564 | break; |
3565 | 3565 | } |
3566 | 3566 | } |
3567 | 3567 | if ($argumentCountError) { |
3568 | - return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, " . $expectedArgumentCountString . ' expected'); |
|
3568 | + return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, ".$expectedArgumentCountString.' expected'); |
|
3569 | 3569 | } |
3570 | 3570 | } |
3571 | 3571 | ++$index; |
@@ -3597,7 +3597,7 @@ discard block |
||
3597 | 3597 | } |
3598 | 3598 | // make sure there was a function |
3599 | 3599 | $d = $stack->last(2); |
3600 | - if (!preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { |
|
3600 | + if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { |
|
3601 | 3601 | return $this->raiseFormulaError('Formula Error: Unexpected ,'); |
3602 | 3602 | } |
3603 | 3603 | $d = $stack->pop(); |
@@ -3621,7 +3621,7 @@ discard block |
||
3621 | 3621 | $val = $match[1]; |
3622 | 3622 | $length = strlen($val); |
3623 | 3623 | |
3624 | - if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $val, $matches)) { |
|
3624 | + if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) { |
|
3625 | 3625 | $val = preg_replace('/\s/u', '', $val); |
3626 | 3626 | if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function |
3627 | 3627 | $valToUpper = strtoupper($val); |
@@ -3642,17 +3642,17 @@ discard block |
||
3642 | 3642 | // tests if the function is closed right after opening |
3643 | 3643 | $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index + $length), $amatch); |
3644 | 3644 | if ($ax) { |
3645 | - $stack->push('Operand Count for Function ' . $valToUpper . ')', 0, null, $currentCondition, $currentOnlyIf, $currentOnlyIfNot); |
|
3645 | + $stack->push('Operand Count for Function '.$valToUpper.')', 0, null, $currentCondition, $currentOnlyIf, $currentOnlyIfNot); |
|
3646 | 3646 | $expectingOperator = true; |
3647 | 3647 | } else { |
3648 | - $stack->push('Operand Count for Function ' . $valToUpper . ')', 1, null, $currentCondition, $currentOnlyIf, $currentOnlyIfNot); |
|
3648 | + $stack->push('Operand Count for Function '.$valToUpper.')', 1, null, $currentCondition, $currentOnlyIf, $currentOnlyIfNot); |
|
3649 | 3649 | $expectingOperator = false; |
3650 | 3650 | } |
3651 | 3651 | $stack->push('Brace', '('); |
3652 | 3652 | } else { // it's a var w/ implicit multiplication |
3653 | 3653 | $output[] = ['type' => 'Value', 'value' => $matches[1], 'reference' => null]; |
3654 | 3654 | } |
3655 | - } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $val, $matches)) { |
|
3655 | + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $val, $matches)) { |
|
3656 | 3656 | // Watch for this case-change when modifying to allow cell references in different worksheets... |
3657 | 3657 | // Should only be applied to the actual cell column, not the worksheet name |
3658 | 3658 | |
@@ -3664,9 +3664,9 @@ discard block |
||
3664 | 3664 | // Otherwise, we 'inherit' the worksheet reference from the start cell reference |
3665 | 3665 | // The start of the cell range reference should be the last entry in $output |
3666 | 3666 | $startCellRef = $output[count($output) - 1]['value']; |
3667 | - preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $startCellRef, $startMatches); |
|
3667 | + preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $startCellRef, $startMatches); |
|
3668 | 3668 | if ($startMatches[2] > '') { |
3669 | - $val = $startMatches[2] . '!' . $val; |
|
3669 | + $val = $startMatches[2].'!'.$val; |
|
3670 | 3670 | } |
3671 | 3671 | } else { |
3672 | 3672 | return $this->raiseFormulaError('3D Range references are not yet supported'); |
@@ -3700,14 +3700,14 @@ discard block |
||
3700 | 3700 | ($startRowColRef <= 1048576) && ($val <= 1048576)) { |
3701 | 3701 | // Row range |
3702 | 3702 | $endRowColRef = ($refSheet !== null) ? $refSheet->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007 |
3703 | - $output[count($output) - 1]['value'] = $rangeWS1 . 'A' . $startRowColRef; |
|
3704 | - $val = $rangeWS2 . $endRowColRef . $val; |
|
3703 | + $output[count($output) - 1]['value'] = $rangeWS1.'A'.$startRowColRef; |
|
3704 | + $val = $rangeWS2.$endRowColRef.$val; |
|
3705 | 3705 | } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) && |
3706 | 3706 | (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) { |
3707 | 3707 | // Column range |
3708 | 3708 | $endRowColRef = ($refSheet !== null) ? $refSheet->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007 |
3709 | - $output[count($output) - 1]['value'] = $rangeWS1 . strtoupper($startRowColRef) . '1'; |
|
3710 | - $val = $rangeWS2 . $val . $endRowColRef; |
|
3709 | + $output[count($output) - 1]['value'] = $rangeWS1.strtoupper($startRowColRef).'1'; |
|
3710 | + $val = $rangeWS2.$val.$endRowColRef; |
|
3711 | 3711 | } |
3712 | 3712 | } |
3713 | 3713 | |
@@ -3769,7 +3769,7 @@ discard block |
||
3769 | 3769 | } |
3770 | 3770 | // If we're expecting an operator, but only have a space between the previous and next operands (and both are |
3771 | 3771 | // Cell References) then we have an INTERSECTION operator |
3772 | - if (($expectingOperator) && (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/Ui', substr($formula, $index), $match)) && |
|
3772 | + if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) && |
|
3773 | 3773 | ($output[count($output) - 1]['type'] == 'Cell Reference')) { |
3774 | 3774 | while ($stack->count() > 0 && |
3775 | 3775 | ($o2 = $stack->last()) && |
@@ -3802,7 +3802,7 @@ discard block |
||
3802 | 3802 | $cKeys = array_keys(array_keys($operand[$rowKey])); |
3803 | 3803 | $colKey = array_shift($cKeys); |
3804 | 3804 | if (ctype_upper($colKey)) { |
3805 | - $operandData['reference'] = $colKey . $rowKey; |
|
3805 | + $operandData['reference'] = $colKey.$rowKey; |
|
3806 | 3806 | } |
3807 | 3807 | } |
3808 | 3808 | |
@@ -3859,17 +3859,17 @@ discard block |
||
3859 | 3859 | ) |
3860 | 3860 | ) { |
3861 | 3861 | // If branching value is not true, we don't need to compute |
3862 | - if (!isset($fakedForBranchPruning['onlyIf-' . $onlyIfStoreKey])) { |
|
3863 | - $stack->push('Value', 'Pruned branch (only if ' . $onlyIfStoreKey . ') ' . $token); |
|
3864 | - $fakedForBranchPruning['onlyIf-' . $onlyIfStoreKey] = true; |
|
3862 | + if (!isset($fakedForBranchPruning['onlyIf-'.$onlyIfStoreKey])) { |
|
3863 | + $stack->push('Value', 'Pruned branch (only if '.$onlyIfStoreKey.') '.$token); |
|
3864 | + $fakedForBranchPruning['onlyIf-'.$onlyIfStoreKey] = true; |
|
3865 | 3865 | } |
3866 | 3866 | |
3867 | 3867 | if (isset($storeKey)) { |
3868 | 3868 | // We are processing an if condition |
3869 | 3869 | // We cascade the pruning to the depending branches |
3870 | 3870 | $branchStore[$storeKey] = 'Pruned branch'; |
3871 | - $fakedForBranchPruning['onlyIfNot-' . $storeKey] = true; |
|
3872 | - $fakedForBranchPruning['onlyIf-' . $storeKey] = true; |
|
3871 | + $fakedForBranchPruning['onlyIfNot-'.$storeKey] = true; |
|
3872 | + $fakedForBranchPruning['onlyIf-'.$storeKey] = true; |
|
3873 | 3873 | } |
3874 | 3874 | |
3875 | 3875 | continue; |
@@ -3892,17 +3892,17 @@ discard block |
||
3892 | 3892 | || ($storeValue === 'Pruned branch')) |
3893 | 3893 | ) { |
3894 | 3894 | // If branching value is true, we don't need to compute |
3895 | - if (!isset($fakedForBranchPruning['onlyIfNot-' . $onlyIfNotStoreKey])) { |
|
3896 | - $stack->push('Value', 'Pruned branch (only if not ' . $onlyIfNotStoreKey . ') ' . $token); |
|
3897 | - $fakedForBranchPruning['onlyIfNot-' . $onlyIfNotStoreKey] = true; |
|
3895 | + if (!isset($fakedForBranchPruning['onlyIfNot-'.$onlyIfNotStoreKey])) { |
|
3896 | + $stack->push('Value', 'Pruned branch (only if not '.$onlyIfNotStoreKey.') '.$token); |
|
3897 | + $fakedForBranchPruning['onlyIfNot-'.$onlyIfNotStoreKey] = true; |
|
3898 | 3898 | } |
3899 | 3899 | |
3900 | 3900 | if (isset($storeKey)) { |
3901 | 3901 | // We are processing an if condition |
3902 | 3902 | // We cascade the pruning to the depending branches |
3903 | 3903 | $branchStore[$storeKey] = 'Pruned branch'; |
3904 | - $fakedForBranchPruning['onlyIfNot-' . $storeKey] = true; |
|
3905 | - $fakedForBranchPruning['onlyIf-' . $storeKey] = true; |
|
3904 | + $fakedForBranchPruning['onlyIfNot-'.$storeKey] = true; |
|
3905 | + $fakedForBranchPruning['onlyIf-'.$storeKey] = true; |
|
3906 | 3906 | } |
3907 | 3907 | |
3908 | 3908 | continue; |
@@ -3960,20 +3960,20 @@ discard block |
||
3960 | 3960 | if ($sheet1 == $sheet2) { |
3961 | 3961 | if ($operand1Data['reference'] === null) { |
3962 | 3962 | if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) { |
3963 | - $operand1Data['reference'] = $pCell->getColumn() . $operand1Data['value']; |
|
3963 | + $operand1Data['reference'] = $pCell->getColumn().$operand1Data['value']; |
|
3964 | 3964 | } elseif (trim($operand1Data['reference']) == '') { |
3965 | 3965 | $operand1Data['reference'] = $pCell->getCoordinate(); |
3966 | 3966 | } else { |
3967 | - $operand1Data['reference'] = $operand1Data['value'] . $pCell->getRow(); |
|
3967 | + $operand1Data['reference'] = $operand1Data['value'].$pCell->getRow(); |
|
3968 | 3968 | } |
3969 | 3969 | } |
3970 | 3970 | if ($operand2Data['reference'] === null) { |
3971 | 3971 | if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) { |
3972 | - $operand2Data['reference'] = $pCell->getColumn() . $operand2Data['value']; |
|
3972 | + $operand2Data['reference'] = $pCell->getColumn().$operand2Data['value']; |
|
3973 | 3973 | } elseif (trim($operand2Data['reference']) == '') { |
3974 | 3974 | $operand2Data['reference'] = $pCell->getCoordinate(); |
3975 | 3975 | } else { |
3976 | - $operand2Data['reference'] = $operand2Data['value'] . $pCell->getRow(); |
|
3976 | + $operand2Data['reference'] = $operand2Data['value'].$pCell->getRow(); |
|
3977 | 3977 | } |
3978 | 3978 | } |
3979 | 3979 | |
@@ -3984,7 +3984,7 @@ discard block |
||
3984 | 3984 | $oCol[] = Coordinate::columnIndexFromString($oCR[0]) - 1; |
3985 | 3985 | $oRow[] = $oCR[1]; |
3986 | 3986 | } |
3987 | - $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow); |
|
3987 | + $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1).min($oRow).':'.Coordinate::stringFromColumnIndex(max($oCol) + 1).max($oRow); |
|
3988 | 3988 | if ($pCellParent !== null) { |
3989 | 3989 | $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($sheet1), false); |
3990 | 3990 | } else { |
@@ -4056,7 +4056,7 @@ discard block |
||
4056 | 4056 | $result = '#VALUE!'; |
4057 | 4057 | } |
4058 | 4058 | } else { |
4059 | - $result = '"' . str_replace('""', '"', self::unwrapResult($operand1) . self::unwrapResult($operand2)) . '"'; |
|
4059 | + $result = '"'.str_replace('""', '"', self::unwrapResult($operand1).self::unwrapResult($operand2)).'"'; |
|
4060 | 4060 | } |
4061 | 4061 | $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); |
4062 | 4062 | $stack->push('Value', $result); |
@@ -4076,7 +4076,7 @@ discard block |
||
4076 | 4076 | $cellIntersect[$row] = array_intersect_key($operand1[$row], $operand2[$row]); |
4077 | 4077 | } |
4078 | 4078 | } |
4079 | - $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow); |
|
4079 | + $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1).min($oRow).':'.Coordinate::stringFromColumnIndex(max($oCol) + 1).max($oRow); |
|
4080 | 4080 | $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($cellIntersect)); |
4081 | 4081 | $stack->push('Value', $cellIntersect, $cellRef); |
4082 | 4082 | |
@@ -4115,14 +4115,14 @@ discard block |
||
4115 | 4115 | } else { |
4116 | 4116 | $this->executeNumericBinaryOperation($multiplier, $arg, '*', 'arrayTimesEquals', $stack); |
4117 | 4117 | } |
4118 | - } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token, $matches)) { |
|
4118 | + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $token, $matches)) { |
|
4119 | 4119 | $cellRef = null; |
4120 | 4120 | if (isset($matches[8])) { |
4121 | 4121 | if ($pCell === null) { |
4122 | 4122 | // We can't access the range, so return a REF error |
4123 | 4123 | $cellValue = Functions::REF(); |
4124 | 4124 | } else { |
4125 | - $cellRef = $matches[6] . $matches[7] . ':' . $matches[9] . $matches[10]; |
|
4125 | + $cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10]; |
|
4126 | 4126 | if ($matches[2] > '') { |
4127 | 4127 | $matches[2] = trim($matches[2], "\"'"); |
4128 | 4128 | if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) { |
@@ -4152,7 +4152,7 @@ discard block |
||
4152 | 4152 | // We can't access the cell, so return a REF error |
4153 | 4153 | $cellValue = Functions::REF(); |
4154 | 4154 | } else { |
4155 | - $cellRef = $matches[6] . $matches[7]; |
|
4155 | + $cellRef = $matches[6].$matches[7]; |
|
4156 | 4156 | if ($matches[2] > '') { |
4157 | 4157 | $matches[2] = trim($matches[2], "\"'"); |
4158 | 4158 | if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) { |
@@ -4190,7 +4190,7 @@ discard block |
||
4190 | 4190 | } |
4191 | 4191 | |
4192 | 4192 | // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on |
4193 | - } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $token, $matches)) { |
|
4193 | + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $token, $matches)) { |
|
4194 | 4194 | if ($pCellParent) { |
4195 | 4195 | $pCell->attach($pCellParent); |
4196 | 4196 | } |
@@ -4249,7 +4249,7 @@ discard block |
||
4249 | 4249 | if ($functionName != 'MKMATRIX') { |
4250 | 4250 | if ($this->debugLog->getWriteDebugLog()) { |
4251 | 4251 | krsort($argArrayVals); |
4252 | - $this->debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator . ' ', Functions::flattenArray($argArrayVals)), ' )'); |
|
4252 | + $this->debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator.' ', Functions::flattenArray($argArrayVals)), ' )'); |
|
4253 | 4253 | } |
4254 | 4254 | } |
4255 | 4255 | |
@@ -4288,7 +4288,7 @@ discard block |
||
4288 | 4288 | $branchStore[$storeKey] = $token; |
4289 | 4289 | } |
4290 | 4290 | // if the token is a named range, push the named range name onto the stack |
4291 | - } elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) { |
|
4291 | + } elseif (preg_match('/^'.self::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $token, $matches)) { |
|
4292 | 4292 | $namedRange = $matches[6]; |
4293 | 4293 | $this->debugLog->writeDebugLog('Evaluating Named Range ', $namedRange); |
4294 | 4294 | |
@@ -4362,7 +4362,7 @@ discard block |
||
4362 | 4362 | * |
4363 | 4363 | * @return mixed |
4364 | 4364 | */ |
4365 | - private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, Stack &$stack, $recursingArrays = false) |
|
4365 | + private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, Stack & $stack, $recursingArrays = false) |
|
4366 | 4366 | { |
4367 | 4367 | // If we're dealing with matrix operations, we want a matrix result |
4368 | 4368 | if ((is_array($operand1)) || (is_array($operand2))) { |
@@ -4630,7 +4630,7 @@ discard block |
||
4630 | 4630 | |
4631 | 4631 | // Extract range |
4632 | 4632 | $aReferences = Coordinate::extractAllCellReferencesInRange($pRange); |
4633 | - $pRange = $pSheetName . '!' . $pRange; |
|
4633 | + $pRange = $pSheetName.'!'.$pRange; |
|
4634 | 4634 | if (!isset($aReferences[1])) { |
4635 | 4635 | $currentCol = ''; |
4636 | 4636 | $currentRow = 0; |
@@ -4689,9 +4689,9 @@ discard block |
||
4689 | 4689 | $splitRange = Coordinate::splitRange($pRange); |
4690 | 4690 | // Convert row and column references |
4691 | 4691 | if (ctype_alpha($splitRange[0][0])) { |
4692 | - $pRange = $splitRange[0][0] . '1:' . $splitRange[0][1] . $namedRange->getWorksheet()->getHighestRow(); |
|
4692 | + $pRange = $splitRange[0][0].'1:'.$splitRange[0][1].$namedRange->getWorksheet()->getHighestRow(); |
|
4693 | 4693 | } elseif (ctype_digit($splitRange[0][0])) { |
4694 | - $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1]; |
|
4694 | + $pRange = 'A'.$splitRange[0][0].':'.$namedRange->getWorksheet()->getHighestColumn().$splitRange[0][1]; |
|
4695 | 4695 | } |
4696 | 4696 | } else { |
4697 | 4697 | return Functions::REF(); |
@@ -4798,7 +4798,7 @@ discard block |
||
4798 | 4798 | |
4799 | 4799 | private function getUnusedBranchStoreKey() |
4800 | 4800 | { |
4801 | - $storeKeyValue = 'storeKey-' . $this->branchStoreKeyCounter; |
|
4801 | + $storeKeyValue = 'storeKey-'.$this->branchStoreKeyCounter; |
|
4802 | 4802 | ++$this->branchStoreKeyCounter; |
4803 | 4803 | |
4804 | 4804 | return $storeKeyValue; |
@@ -4806,7 +4806,7 @@ discard block |
||
4806 | 4806 | |
4807 | 4807 | private function getTokensAsString($tokens) |
4808 | 4808 | { |
4809 | - $tokensStr = array_map(function ($token) { |
|
4809 | + $tokensStr = array_map(function($token) { |
|
4810 | 4810 | $value = $token['value'] ?? 'no value'; |
4811 | 4811 | while (is_array($value)) { |
4812 | 4812 | $value = array_pop($value); |
@@ -4815,6 +4815,6 @@ discard block |
||
4815 | 4815 | return $value; |
4816 | 4816 | }, $tokens); |
4817 | 4817 | |
4818 | - return '[ ' . implode(' | ', $tokensStr) . ' ]'; |
|
4818 | + return '[ '.implode(' | ', $tokensStr).' ]'; |
|
4819 | 4819 | } |
4820 | 4820 | } |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | // Two's Complement |
1103 | 1103 | $x = substr($x, -9); |
1104 | 1104 | |
1105 | - return '-' . (512 - bindec($x)); |
|
1105 | + return '-'.(512 - bindec($x)); |
|
1106 | 1106 | } |
1107 | 1107 | |
1108 | 1108 | return bindec($x); |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | return Functions::NAN(); |
1158 | 1158 | } elseif (strlen($x) == 10) { |
1159 | 1159 | // Two's Complement |
1160 | - return str_repeat('F', 8) . substr(strtoupper(dechex(bindec(substr($x, -9)))), -2); |
|
1160 | + return str_repeat('F', 8).substr(strtoupper(dechex(bindec(substr($x, -9)))), -2); |
|
1161 | 1161 | } |
1162 | 1162 | $hexVal = (string) strtoupper(dechex(bindec($x))); |
1163 | 1163 | |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | return Functions::NAN(); |
1213 | 1213 | } elseif (strlen($x) == 10) { |
1214 | 1214 | // Two's Complement |
1215 | - return str_repeat('7', 7) . substr(strtoupper(decoct(bindec(substr($x, -9)))), -3); |
|
1215 | + return str_repeat('7', 7).substr(strtoupper(decoct(bindec(substr($x, -9)))), -3); |
|
1216 | 1216 | } |
1217 | 1217 | $octVal = (string) decoct(bindec($x)); |
1218 | 1218 | |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | $r = strtoupper(dechex($x)); |
1330 | 1330 | if (strlen($r) == 8) { |
1331 | 1331 | // Two's Complement |
1332 | - $r = 'FF' . $r; |
|
1332 | + $r = 'FF'.$r; |
|
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | return self::nbrConversionFormat($r, $places); |
@@ -32,10 +32,10 @@ |
||
32 | 32 | $eom = self::isLastDayOfMonth($result); |
33 | 33 | |
34 | 34 | while ($settlement < Date::PHPToExcel($result)) { |
35 | - $result->modify('-' . $months . ' months'); |
|
35 | + $result->modify('-'.$months.' months'); |
|
36 | 36 | } |
37 | 37 | if ($next) { |
38 | - $result->modify('+' . $months . ' months'); |
|
38 | + $result->modify('+'.$months.' months'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | if ($eom) { |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } elseif (!$conditionIsNumeric) { |
732 | 732 | continue; |
733 | 733 | } |
734 | - $testCondition = '=' . $arg . $condition; |
|
734 | + $testCondition = '='.$arg.$condition; |
|
735 | 735 | if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
736 | 736 | $returnValue += $averageArgs[$key]; |
737 | 737 | ++$aCount; |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | } elseif (!$conditionIsNumeric) { |
1171 | 1171 | continue; |
1172 | 1172 | } |
1173 | - $testCondition = '=' . $arg . $condition; |
|
1173 | + $testCondition = '='.$arg.$condition; |
|
1174 | 1174 | if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1175 | 1175 | // Is it a value within our criteria |
1176 | 1176 | ++$returnValue; |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | |
1235 | 1235 | break; // if false found, don't need to check other conditions |
1236 | 1236 | } |
1237 | - $testCondition = '=' . $arg . $condition; |
|
1237 | + $testCondition = '='.$arg.$condition; |
|
1238 | 1238 | if (!Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1239 | 1239 | // Is not a value within our criteria |
1240 | 1240 | $valid = false; |
@@ -2263,7 +2263,7 @@ discard block |
||
2263 | 2263 | if (!is_numeric($arg)) { |
2264 | 2264 | $arg = Calculation::wrapResult(strtoupper($arg)); |
2265 | 2265 | } |
2266 | - $testCondition = '=' . $arg . $condition; |
|
2266 | + $testCondition = '='.$arg.$condition; |
|
2267 | 2267 | if (!Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
2268 | 2268 | // Is not a value within our criteria |
2269 | 2269 | $valid = false; |
@@ -2443,7 +2443,7 @@ discard block |
||
2443 | 2443 | if (!is_numeric($arg)) { |
2444 | 2444 | $arg = Calculation::wrapResult(strtoupper($arg)); |
2445 | 2445 | } |
2446 | - $testCondition = '=' . $arg . $condition; |
|
2446 | + $testCondition = '='.$arg.$condition; |
|
2447 | 2447 | if (!Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
2448 | 2448 | // Is not a value within our criteria |
2449 | 2449 | $valid = false; |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | $testConditionCount = 0; |
68 | 68 | foreach ($criteria as $row => $criterion) { |
69 | 69 | if ($criterion[$key] > '') { |
70 | - $testCondition[] = '[:' . $criteriaName . ']' . Functions::ifCondition($criterion[$key]); |
|
70 | + $testCondition[] = '[:'.$criteriaName.']'.Functions::ifCondition($criterion[$key]); |
|
71 | 71 | ++$testConditionCount; |
72 | 72 | } |
73 | 73 | } |
74 | 74 | if ($testConditionCount > 1) { |
75 | - $testConditions[] = 'OR(' . implode(',', $testCondition) . ')'; |
|
75 | + $testConditions[] = 'OR('.implode(',', $testCondition).')'; |
|
76 | 76 | ++$testConditionsCount; |
77 | 77 | } elseif ($testConditionCount == 1) { |
78 | 78 | $testConditions[] = $testCondition[0]; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | if ($testConditionsCount > 1) { |
84 | - $testConditionSet = 'AND(' . implode(',', $testConditions) . ')'; |
|
84 | + $testConditionSet = 'AND('.implode(',', $testConditions).')'; |
|
85 | 85 | } elseif ($testConditionsCount == 1) { |
86 | 86 | $testConditionSet = $testConditions[0]; |
87 | 87 | } |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | if (isset($dataValues[$k])) { |
96 | 96 | $dataValue = $dataValues[$k]; |
97 | 97 | $dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue; |
98 | - $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList); |
|
98 | + $testConditionList = str_replace('[:'.$criteriaName.']', $dataValue, $testConditionList); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | // evaluate the criteria against the row data |
102 | - $result = Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList); |
|
102 | + $result = Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); |
|
103 | 103 | // If the row failed to meet the criteria, remove it from the database |
104 | 104 | if (!$result) { |
105 | 105 | unset($database[$dataRow]); |
@@ -141,7 +141,7 @@ |
||
141 | 141 | while (is_array($value)) { |
142 | 142 | $value = array_pop($value); |
143 | 143 | } |
144 | - $str .= $value . ' |> '; |
|
144 | + $str .= $value.' |> '; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $str; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | return Functions::VALUE(); |
95 | 95 | } |
96 | 96 | |
97 | - $args = array_filter($args, function ($value) { |
|
97 | + $args = array_filter($args, function($value) { |
|
98 | 98 | return $value !== null || (is_string($value) && trim($value) == ''); |
99 | 99 | }); |
100 | 100 | $argCount = count($args); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | return Functions::VALUE(); |
138 | 138 | } |
139 | 139 | |
140 | - $args = array_filter($args, function ($value) { |
|
140 | + $args = array_filter($args, function($value) { |
|
141 | 141 | return $value !== null || (is_string($value) && trim($value) == ''); |
142 | 142 | }); |
143 | 143 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | return Functions::VALUE(); |
181 | 181 | } |
182 | 182 | |
183 | - $args = array_filter($args, function ($value) { |
|
183 | + $args = array_filter($args, function($value) { |
|
184 | 184 | return $value !== null || (is_string($value) && trim($value) == ''); |
185 | 185 | }); |
186 | 186 |
@@ -1119,7 +1119,7 @@ discard block |
||
1119 | 1119 | $t = self::romanCut($aValue, 10); |
1120 | 1120 | $aValue %= 10; |
1121 | 1121 | |
1122 | - return $roman . $mill[$m] . $cent[$c] . $tens[$t] . $ones[$aValue]; |
|
1122 | + return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue]; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | /** |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | { |
1272 | 1272 | return array_filter( |
1273 | 1273 | $args, |
1274 | - function ($index) use ($cellReference) { |
|
1274 | + function($index) use ($cellReference) { |
|
1275 | 1275 | [, $row, $column] = explode('.', $index); |
1276 | 1276 | |
1277 | 1277 | return $cellReference->getWorksheet()->getRowDimension($row)->getVisible() && |
@@ -1285,12 +1285,12 @@ discard block |
||
1285 | 1285 | { |
1286 | 1286 | return array_filter( |
1287 | 1287 | $args, |
1288 | - function ($index) use ($cellReference) { |
|
1288 | + function($index) use ($cellReference) { |
|
1289 | 1289 | [, $row, $column] = explode('.', $index); |
1290 | - if ($cellReference->getWorksheet()->cellExists($column . $row)) { |
|
1290 | + if ($cellReference->getWorksheet()->cellExists($column.$row)) { |
|
1291 | 1291 | //take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula |
1292 | - $isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula(); |
|
1293 | - $cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue()); |
|
1292 | + $isFormula = $cellReference->getWorksheet()->getCell($column.$row)->isFormula(); |
|
1293 | + $cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column.$row)->getValue()); |
|
1294 | 1294 | |
1295 | 1295 | return !$isFormula || $cellFormula; |
1296 | 1296 | } |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | $arg = Calculation::wrapResult(strtoupper($arg)); |
1422 | 1422 | } |
1423 | 1423 | |
1424 | - $testCondition = '=' . $arg . $condition; |
|
1424 | + $testCondition = '='.$arg.$condition; |
|
1425 | 1425 | $sumValue = array_key_exists($key, $sumArgs) ? $sumArgs[$key] : 0; |
1426 | 1426 | |
1427 | 1427 | if (is_numeric($sumValue) && |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | if (!is_numeric($arg)) { |
1477 | 1477 | $arg = Calculation::wrapResult(strtoupper($arg)); |
1478 | 1478 | } |
1479 | - $testCondition = '=' . $arg . $condition; |
|
1479 | + $testCondition = '='.$arg.$condition; |
|
1480 | 1480 | if (!Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1481 | 1481 | // Is not a value within our criteria |
1482 | 1482 | $valid = false; |