@@ -76,7 +76,7 @@ |
||
76 | 76 | |
77 | 77 | private $softEdges = [ |
78 | 78 | 'size' => null, |
79 | - ]; |
|
79 | + ]; |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Get Object State |
@@ -29,12 +29,12 @@ |
||
29 | 29 | class Legend |
30 | 30 | { |
31 | 31 | /** Legend positions */ |
32 | - const XL_LEGEND_POSITION_BOTTOM = -4107; // Below the chart. |
|
33 | - const XL_LEGEND_POSITION_CORNER = 2; // In the upper right-hand corner of the chart border. |
|
34 | - const XL_LEGEND_POSITION_CUSTOM = -4161; // A custom position. |
|
35 | - const XL_LEGEND_POSITION_LEFT = -4131; // Left of the chart. |
|
36 | - const XL_LEGEND_POSITION_RIGHT = -4152; // Right of the chart. |
|
37 | - const XL_LEGEND_POSITION_TOP = -4160; // Above the chart. |
|
32 | + const XL_LEGEND_POSITION_BOTTOM = -4107; // Below the chart. |
|
33 | + const XL_LEGEND_POSITION_CORNER = 2; // In the upper right-hand corner of the chart border. |
|
34 | + const XL_LEGEND_POSITION_CUSTOM = -4161; // A custom position. |
|
35 | + const XL_LEGEND_POSITION_LEFT = -4131; // Left of the chart. |
|
36 | + const XL_LEGEND_POSITION_RIGHT = -4152; // Right of the chart. |
|
37 | + const XL_LEGEND_POSITION_TOP = -4160; // Above the chart. |
|
38 | 38 | |
39 | 39 | const POSITION_RIGHT = 'r'; |
40 | 40 | const POSITION_LEFT = 'l'; |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | $firstinterest = Functions::flattenSingleValue($firstinterest); |
181 | 181 | $settlement = Functions::flattenSingleValue($settlement); |
182 | 182 | $rate = Functions::flattenSingleValue($rate); |
183 | - $par = (is_null($par)) ? 1000 : Functions::flattenSingleValue($par); |
|
184 | - $frequency = (is_null($frequency)) ? 1 : Functions::flattenSingleValue($frequency); |
|
185 | - $basis = (is_null($basis)) ? 0 : Functions::flattenSingleValue($basis); |
|
183 | + $par = (is_null($par)) ? 1000 : Functions::flattenSingleValue($par); |
|
184 | + $frequency = (is_null($frequency)) ? 1 : Functions::flattenSingleValue($frequency); |
|
185 | + $basis = (is_null($basis)) ? 0 : Functions::flattenSingleValue($basis); |
|
186 | 186 | |
187 | 187 | // Validate |
188 | 188 | if ((is_numeric($rate)) && (is_numeric($par))) { |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | $issue = Functions::flattenSingleValue($issue); |
231 | 231 | $settlement = Functions::flattenSingleValue($settlement); |
232 | 232 | $rate = Functions::flattenSingleValue($rate); |
233 | - $par = (is_null($par)) ? 1000 : Functions::flattenSingleValue($par); |
|
234 | - $basis = (is_null($basis)) ? 0 : Functions::flattenSingleValue($basis); |
|
233 | + $par = (is_null($par)) ? 1000 : Functions::flattenSingleValue($par); |
|
234 | + $basis = (is_null($basis)) ? 0 : Functions::flattenSingleValue($basis); |
|
235 | 235 | |
236 | 236 | // Validate |
237 | 237 | if ((is_numeric($rate)) && (is_numeric($par))) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $salvage = Functions::flattenSingleValue($salvage); |
291 | 291 | $period = floor(Functions::flattenSingleValue($period)); |
292 | 292 | $rate = Functions::flattenSingleValue($rate); |
293 | - $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
293 | + $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
294 | 294 | |
295 | 295 | // The depreciation coefficients are: |
296 | 296 | // Life of assets (1/rate) Depreciation coefficient |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $settlement = Functions::flattenSingleValue($settlement); |
618 | 618 | $maturity = Functions::flattenSingleValue($maturity); |
619 | 619 | $frequency = (int) Functions::flattenSingleValue($frequency); |
620 | - $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
620 | + $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
621 | 621 | |
622 | 622 | if (is_string($settlement = DateTime::getDateValue($settlement))) { |
623 | 623 | return Functions::VALUE(); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | $settlement = Functions::flattenSingleValue($settlement); |
673 | 673 | $maturity = Functions::flattenSingleValue($maturity); |
674 | 674 | $frequency = (int) Functions::flattenSingleValue($frequency); |
675 | - $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
675 | + $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
676 | 676 | |
677 | 677 | if (is_string($settlement = DateTime::getDateValue($settlement))) { |
678 | 678 | return Functions::VALUE(); |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $settlement = Functions::flattenSingleValue($settlement); |
744 | 744 | $maturity = Functions::flattenSingleValue($maturity); |
745 | 745 | $frequency = (int) Functions::flattenSingleValue($frequency); |
746 | - $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
746 | + $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
747 | 747 | |
748 | 748 | if (is_string($settlement = DateTime::getDateValue($settlement))) { |
749 | 749 | return Functions::VALUE(); |
@@ -1619,7 +1619,7 @@ discard block |
||
1619 | 1619 | $yield = (float) Functions::flattenSingleValue($yield); |
1620 | 1620 | $redemption = (float) Functions::flattenSingleValue($redemption); |
1621 | 1621 | $frequency = (int) Functions::flattenSingleValue($frequency); |
1622 | - $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
1622 | + $basis = (is_null($basis)) ? 0 : (int) Functions::flattenSingleValue($basis); |
|
1623 | 1623 | |
1624 | 1624 | if (is_string($settlement = DateTime::getDateValue($settlement))) { |
1625 | 1625 | return Functions::VALUE(); |
@@ -1828,9 +1828,9 @@ discard block |
||
1828 | 1828 | $nper = (int) Functions::flattenSingleValue($nper); |
1829 | 1829 | $pmt = Functions::flattenSingleValue($pmt); |
1830 | 1830 | $pv = Functions::flattenSingleValue($pv); |
1831 | - $fv = (is_null($fv)) ? 0.0 : Functions::flattenSingleValue($fv); |
|
1832 | - $type = (is_null($type)) ? 0 : (int) Functions::flattenSingleValue($type); |
|
1833 | - $guess = (is_null($guess)) ? 0.1 : Functions::flattenSingleValue($guess); |
|
1831 | + $fv = (is_null($fv)) ? 0.0 : Functions::flattenSingleValue($fv); |
|
1832 | + $type = (is_null($type)) ? 0 : (int) Functions::flattenSingleValue($type); |
|
1833 | + $guess = (is_null($guess)) ? 0.1 : Functions::flattenSingleValue($guess); |
|
1834 | 1834 | |
1835 | 1835 | $rate = $guess; |
1836 | 1836 | if (abs($rate) < FINANCIAL_PRECISION) { |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) || |
498 | 498 | (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) || |
499 | 499 | ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND) |
500 | - )) { |
|
500 | + )) { |
|
501 | 501 | continue; |
502 | 502 | } |
503 | 503 | |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | (($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) || |
510 | 510 | (($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) || |
511 | 511 | ($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND) |
512 | - )) { |
|
512 | + )) { |
|
513 | 513 | continue; |
514 | 514 | } |
515 | 515 |
@@ -260,7 +260,7 @@ |
||
260 | 260 | $args = func_get_args(); |
261 | 261 | $pCell = array_pop($args); |
262 | 262 | |
263 | - $linkURL = (is_null($linkURL)) ? '' : Functions::flattenSingleValue($linkURL); |
|
263 | + $linkURL = (is_null($linkURL)) ? '' : Functions::flattenSingleValue($linkURL); |
|
264 | 264 | $displayName = (is_null($displayName)) ? '' : Functions::flattenSingleValue($displayName); |
265 | 265 | |
266 | 266 | if ((!is_object($pCell)) || (trim($linkURL) == '')) { |
@@ -913,7 +913,7 @@ |
||
913 | 913 | public static function ROMAN($aValue, $style = 0) |
914 | 914 | { |
915 | 915 | $aValue = Functions::flattenSingleValue($aValue); |
916 | - $style = (is_null($style)) ? 0 : (integer) Functions::flattenSingleValue($style); |
|
916 | + $style = (is_null($style)) ? 0 : (integer) Functions::flattenSingleValue($style); |
|
917 | 917 | if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) { |
918 | 918 | return Functions::VALUE(); |
919 | 919 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | 'NULL' => null, |
233 | 233 | ]; |
234 | 234 | |
235 | - // PhpSpreadsheet functions |
|
235 | + // PhpSpreadsheet functions |
|
236 | 236 | private static $phpSpreadsheetFunctions = [ |
237 | 237 | 'ABS' => [ |
238 | 238 | 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, |
@@ -3073,13 +3073,13 @@ discard block |
||
3073 | 3073 | $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; |
3074 | 3074 | |
3075 | 3075 | $regexpMatchString = '/^(' . self::CALCULATION_REGEXP_FUNCTION . |
3076 | - '|' . self::CALCULATION_REGEXP_CELLREF . |
|
3077 | - '|' . self::CALCULATION_REGEXP_NUMBER . |
|
3078 | - '|' . self::CALCULATION_REGEXP_STRING . |
|
3079 | - '|' . self::CALCULATION_REGEXP_OPENBRACE . |
|
3080 | - '|' . self::CALCULATION_REGEXP_NAMEDRANGE . |
|
3081 | - '|' . self::CALCULATION_REGEXP_ERROR . |
|
3082 | - ')/si'; |
|
3076 | + '|' . self::CALCULATION_REGEXP_CELLREF . |
|
3077 | + '|' . self::CALCULATION_REGEXP_NUMBER . |
|
3078 | + '|' . self::CALCULATION_REGEXP_STRING . |
|
3079 | + '|' . self::CALCULATION_REGEXP_OPENBRACE . |
|
3080 | + '|' . self::CALCULATION_REGEXP_NAMEDRANGE . |
|
3081 | + '|' . self::CALCULATION_REGEXP_ERROR . |
|
3082 | + ')/si'; |
|
3083 | 3083 | |
3084 | 3084 | // Start with initialisation |
3085 | 3085 | $index = 0; |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | * @var array |
110 | 110 | */ |
111 | 111 | private static $operators = [ |
112 | - '+' => true, '-' => true, '*' => true, '/' => true, |
|
113 | - '^' => true, '&' => true, '%' => false, '~' => false, |
|
114 | - '>' => true, '<' => true, '=' => true, '>=' => true, |
|
115 | - '<=' => true, '<>' => true, '|' => true, ':' => true, |
|
112 | + '+' => true, '-' => true, '*' => true, '/' => true, |
|
113 | + '^' => true, '&' => true, '%' => false, '~' => false, |
|
114 | + '>' => true, '<' => true, '=' => true, '>=' => true, |
|
115 | + '<=' => true, '<>' => true, '|' => true, ':' => true, |
|
116 | 116 | ]; |
117 | 117 | |
118 | 118 | /** |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | * @var array |
122 | 122 | */ |
123 | 123 | private static $binaryOperators = [ |
124 | - '+' => true, '-' => true, '*' => true, '/' => true, |
|
125 | - '^' => true, '&' => true, '>' => true, '<' => true, |
|
126 | - '=' => true, '>=' => true, '<=' => true, '<>' => true, |
|
127 | - '|' => true, ':' => true, |
|
124 | + '+' => true, '-' => true, '*' => true, '/' => true, |
|
125 | + '^' => true, '&' => true, '>' => true, '<' => true, |
|
126 | + '=' => true, '>=' => true, '<=' => true, '<>' => true, |
|
127 | + '|' => true, ':' => true, |
|
128 | 128 | ]; |
129 | 129 | |
130 | 130 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @var string |
191 | 191 | */ |
192 | - private static $localeLanguage = 'en_us'; // US English (default locale) |
|
192 | + private static $localeLanguage = 'en_us'; // US English (default locale) |
|
193 | 193 | |
194 | 194 | /** |
195 | 195 | * List of available locale settings |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @var string[] |
199 | 199 | */ |
200 | 200 | private static $validLocaleLanguages = [ |
201 | - 'en', // English (default language) |
|
201 | + 'en', // English (default language) |
|
202 | 202 | ]; |
203 | 203 | |
204 | 204 | /** |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | // Retrieve the list of locale or language specific function names |
2280 | 2280 | $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
2281 | 2281 | foreach ($localeFunctions as $localeFunction) { |
2282 | - list($localeFunction) = explode('##', $localeFunction); // Strip out comments |
|
2282 | + list($localeFunction) = explode('##', $localeFunction); // Strip out comments |
|
2283 | 2283 | if (strpos($localeFunction, '=') !== false) { |
2284 | 2284 | list($fName, $lfName) = explode('=', $localeFunction); |
2285 | 2285 | $fName = trim($fName); |
@@ -2304,7 +2304,7 @@ discard block |
||
2304 | 2304 | if (file_exists($configFile)) { |
2305 | 2305 | $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
2306 | 2306 | foreach ($localeSettings as $localeSetting) { |
2307 | - list($localeSetting) = explode('##', $localeSetting); // Strip out comments |
|
2307 | + list($localeSetting) = explode('##', $localeSetting); // Strip out comments |
|
2308 | 2308 | if (strpos($localeSetting, '=') !== false) { |
2309 | 2309 | list($settingName, $settingValue) = explode('=', $localeSetting); |
2310 | 2310 | $settingName = strtoupper(trim($settingName)); |
@@ -3034,12 +3034,12 @@ discard block |
||
3034 | 3034 | // These operators always work on two values |
3035 | 3035 | // Array key is the operator, the value indicates whether this is a left or right associative operator |
3036 | 3036 | private static $operatorAssociativity = [ |
3037 | - '^' => 0, // Exponentiation |
|
3038 | - '*' => 0, '/' => 0, // Multiplication and Division |
|
3039 | - '+' => 0, '-' => 0, // Addition and Subtraction |
|
3040 | - '&' => 0, // Concatenation |
|
3041 | - '|' => 0, ':' => 0, // Intersect and Range |
|
3042 | - '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison |
|
3037 | + '^' => 0, // Exponentiation |
|
3038 | + '*' => 0, '/' => 0, // Multiplication and Division |
|
3039 | + '+' => 0, '-' => 0, // Addition and Subtraction |
|
3040 | + '&' => 0, // Concatenation |
|
3041 | + '|' => 0, ':' => 0, // Intersect and Range |
|
3042 | + '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison |
|
3043 | 3043 | ]; |
3044 | 3044 | |
3045 | 3045 | // Comparison (Boolean) Operators |
@@ -3050,15 +3050,15 @@ discard block |
||
3050 | 3050 | // This list includes all valid operators, whether binary (including boolean) or unary (such as %) |
3051 | 3051 | // Array key is the operator, the value is its precedence |
3052 | 3052 | private static $operatorPrecedence = [ |
3053 | - ':' => 8, // Range |
|
3054 | - '|' => 7, // Intersect |
|
3055 | - '~' => 6, // Negation |
|
3056 | - '%' => 5, // Percentage |
|
3057 | - '^' => 4, // Exponentiation |
|
3058 | - '*' => 3, '/' => 3, // Multiplication and Division |
|
3059 | - '+' => 2, '-' => 2, // Addition and Subtraction |
|
3060 | - '&' => 1, // Concatenation |
|
3061 | - '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison |
|
3053 | + ':' => 8, // Range |
|
3054 | + '|' => 7, // Intersect |
|
3055 | + '~' => 6, // Negation |
|
3056 | + '%' => 5, // Percentage |
|
3057 | + '^' => 4, // Exponentiation |
|
3058 | + '*' => 3, '/' => 3, // Multiplication and Division |
|
3059 | + '+' => 2, '-' => 2, // Addition and Subtraction |
|
3060 | + '&' => 1, // Concatenation |
|
3061 | + '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison |
|
3062 | 3062 | ]; |
3063 | 3063 | |
3064 | 3064 | // Convert infix to postfix notation |
@@ -3085,9 +3085,9 @@ discard block |
||
3085 | 3085 | $index = 0; |
3086 | 3086 | $stack = new Calculation\Token\Stack(); |
3087 | 3087 | $output = []; |
3088 | - $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a |
|
3088 | + $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a |
|
3089 | 3089 | // - is a negation or + is a positive operator rather than an operation |
3090 | - $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand |
|
3090 | + $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand |
|
3091 | 3091 | // should be null in a function call |
3092 | 3092 | // The guts of the lexical parser |
3093 | 3093 | // Loop through the formula extracting each operator and operand in turn |
@@ -3107,26 +3107,26 @@ discard block |
||
3107 | 3107 | |
3108 | 3108 | if ($opCharacter == '-' && !$expectingOperator) { // Is it a negation instead of a minus? |
3109 | 3109 | //echo 'Element is a Negation operator', PHP_EOL; |
3110 | - $stack->push('Unary Operator', '~'); // Put a negation on the stack |
|
3111 | - ++$index; // and drop the negation symbol |
|
3110 | + $stack->push('Unary Operator', '~'); // Put a negation on the stack |
|
3111 | + ++$index; // and drop the negation symbol |
|
3112 | 3112 | } elseif ($opCharacter == '%' && $expectingOperator) { |
3113 | 3113 | //echo 'Element is a Percentage operator', PHP_EOL; |
3114 | - $stack->push('Unary Operator', '%'); // Put a percentage on the stack |
|
3114 | + $stack->push('Unary Operator', '%'); // Put a percentage on the stack |
|
3115 | 3115 | ++$index; |
3116 | 3116 | } elseif ($opCharacter == '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded? |
3117 | 3117 | //echo 'Element is a Positive number, not Plus operator', PHP_EOL; |
3118 | - ++$index; // Drop the redundant plus symbol |
|
3118 | + ++$index; // Drop the redundant plus symbol |
|
3119 | 3119 | } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) { // We have to explicitly deny a tilde or pipe, because they are legal |
3120 | - return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression |
|
3120 | + return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression |
|
3121 | 3121 | } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack? |
3122 | 3122 | //echo 'Element with value '.$opCharacter.' is an Operator', PHP_EOL; |
3123 | 3123 | while ($stack->count() > 0 && |
3124 | 3124 | ($o2 = $stack->last()) && |
3125 | 3125 | isset(self::$operators[$o2['value']]) && |
3126 | 3126 | @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) { |
3127 | - $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output |
|
3127 | + $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output |
|
3128 | 3128 | } |
3129 | - $stack->push('Binary Operator', $opCharacter); // Finally put our current operator onto the stack |
|
3129 | + $stack->push('Binary Operator', $opCharacter); // Finally put our current operator onto the stack |
|
3130 | 3130 | ++$index; |
3131 | 3131 | $expectingOperator = false; |
3132 | 3132 | } elseif ($opCharacter == ')' && $expectingOperator) { // Are we expecting to close a parenthesis? |
@@ -3141,10 +3141,10 @@ discard block |
||
3141 | 3141 | } |
3142 | 3142 | $d = $stack->last(2); |
3143 | 3143 | if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { // Did this parenthesis just close a function? |
3144 | - $functionName = $matches[1]; // Get the function name |
|
3144 | + $functionName = $matches[1]; // Get the function name |
|
3145 | 3145 | //echo 'Closed Function is '.$functionName, PHP_EOL; |
3146 | 3146 | $d = $stack->pop(); |
3147 | - $argumentCount = $d['value']; // See how many arguments there were (argument count is the next value stored on the stack) |
|
3147 | + $argumentCount = $d['value']; // See how many arguments there were (argument count is the next value stored on the stack) |
|
3148 | 3148 | //if ($argumentCount == 0) { |
3149 | 3149 | // echo 'With no arguments', PHP_EOL; |
3150 | 3150 | //} elseif ($argumentCount == 1) { |
@@ -3152,8 +3152,8 @@ discard block |
||
3152 | 3152 | //} else { |
3153 | 3153 | // echo 'With '.$argumentCount.' arguments', PHP_EOL; |
3154 | 3154 | //} |
3155 | - $output[] = $d; // Dump the argument count on the output |
|
3156 | - $output[] = $stack->pop(); // Pop the function and push onto the output |
|
3155 | + $output[] = $d; // Dump the argument count on the output |
|
3156 | + $output[] = $stack->pop(); // Pop the function and push onto the output |
|
3157 | 3157 | if (isset(self::$controlFunctions[$functionName])) { |
3158 | 3158 | //echo 'Built-in function '.$functionName, PHP_EOL; |
3159 | 3159 | $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount']; |
@@ -3217,7 +3217,7 @@ discard block |
||
3217 | 3217 | if ($o2 === null) { |
3218 | 3218 | return $this->raiseFormulaError('Formula Error: Unexpected ,'); |
3219 | 3219 | } else { |
3220 | - $output[] = $o2; // pop the argument expression stuff and push onto the output |
|
3220 | + $output[] = $o2; // pop the argument expression stuff and push onto the output |
|
3221 | 3221 | } |
3222 | 3222 | } |
3223 | 3223 | // If we've a comma when we're expecting an operand, then what we actually have is a null operand; |
@@ -3231,8 +3231,8 @@ discard block |
||
3231 | 3231 | return $this->raiseFormulaError('Formula Error: Unexpected ,'); |
3232 | 3232 | } |
3233 | 3233 | $d = $stack->pop(); |
3234 | - $stack->push($d['type'], ++$d['value'], $d['reference']); // increment the argument count |
|
3235 | - $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again |
|
3234 | + $stack->push($d['type'], ++$d['value'], $d['reference']); // increment the argument count |
|
3235 | + $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again |
|
3236 | 3236 | $expectingOperator = false; |
3237 | 3237 | $expectingOperand = true; |
3238 | 3238 | ++$index; |
@@ -3311,13 +3311,13 @@ discard block |
||
3311 | 3311 | if ((is_integer($startRowColRef)) && (ctype_digit($val)) && |
3312 | 3312 | ($startRowColRef <= 1048576) && ($val <= 1048576)) { |
3313 | 3313 | // Row range |
3314 | - $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007 |
|
3314 | + $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007 |
|
3315 | 3315 | $output[count($output) - 1]['value'] = $rangeWS1 . 'A' . $startRowColRef; |
3316 | 3316 | $val = $rangeWS2 . $endRowColRef . $val; |
3317 | 3317 | } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) && |
3318 | 3318 | (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) { |
3319 | 3319 | // Column range |
3320 | - $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007 |
|
3320 | + $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007 |
|
3321 | 3321 | $output[count($output) - 1]['value'] = $rangeWS1 . strtoupper($startRowColRef) . '1'; |
3322 | 3322 | $val = $rangeWS2 . $val . $endRowColRef; |
3323 | 3323 | } |
@@ -3395,9 +3395,9 @@ discard block |
||
3395 | 3395 | ($o2 = $stack->last()) && |
3396 | 3396 | isset(self::$operators[$o2['value']]) && |
3397 | 3397 | @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) { |
3398 | - $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output |
|
3398 | + $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output |
|
3399 | 3399 | } |
3400 | - $stack->push('Binary Operator', '|'); // Put an Intersect Operator on the stack |
|
3400 | + $stack->push('Binary Operator', '|'); // Put an Intersect Operator on the stack |
|
3401 | 3401 | $expectingOperator = false; |
3402 | 3402 | } |
3403 | 3403 | } |
@@ -3405,7 +3405,7 @@ discard block |
||
3405 | 3405 | |
3406 | 3406 | while (($op = $stack->pop()) !== null) { // pop everything off the stack and push onto output |
3407 | 3407 | if ((is_array($op) && $op['value'] == '(') || ($op === '(')) { |
3408 | - return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced |
|
3408 | + return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced |
|
3409 | 3409 | } |
3410 | 3410 | $output[] = $op; |
3411 | 3411 | } |
@@ -245,7 +245,7 @@ |
||
245 | 245 | */ |
246 | 246 | public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) |
247 | 247 | { |
248 | - $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; |
|
248 | + $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; |
|
249 | 249 | |
250 | 250 | if (is_null($this->cachePrefix)) { |
251 | 251 | $baseUnique = $this->getUniqueID(); |
@@ -219,8 +219,8 @@ |
||
219 | 219 | } |
220 | 220 | $spreadsheet->setActiveSheetIndex($this->sheetIndex); |
221 | 221 | |
222 | - $fromFormats = ['\-', '\ ']; |
|
223 | - $toFormats = ['-', ' ']; |
|
222 | + $fromFormats = ['\-', '\ ']; |
|
223 | + $toFormats = ['-', ' ']; |
|
224 | 224 | |
225 | 225 | // Loop through file |
226 | 226 | $rowData = []; |