PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | libraries/vendor/PhpSpreadsheet/Calculation/Calculation.php +16 -16 3.3.4 → 3.4 View file →
@@ -565,9 +565,9 @@
565 565 fn (array $matches) => 'ANCHORARRAY(' . substr($matches[0], 0, -1) . ')',
566 566 $value
567 567 );
568 568 }
569 - $result = self::unwrapResult($this->_calculateFormulaValue($value, $cell->getCoordinate(), $cell)); //* @phpstan-ignore-line
569 + $result = self::unwrapResult($this->_calculateFormulaValue($value, $cell->getCoordinate(), $cell)); //* @phpstan-ignore argument.type ($value can be mixed not string)
570 570 if ($this->spreadsheet === null) {
571 571 throw new Exception('null spreadsheet in calculateCellValue');
572 572 }
573 573 $cellAddressAttempted = true;
@@ -585,9 +585,9 @@
585 585 if (!$cellAddressAttempted) {
586 586 $cellAddress = array_pop($this->cellStack);
587 587 }
588 588 if ($this->spreadsheet !== null && is_array($cellAddress) && array_key_exists('sheet', $cellAddress)) {
589 - $sheetName = $cellAddress['sheet'] ?? null;
589 + $sheetName = $cellAddress['sheet'];
590 590 $testSheet = is_string($sheetName) ? $this->spreadsheet->getSheetByName($sheetName) : null;
591 591 if ($testSheet !== null && array_key_exists('cell', $cellAddress)) {
592 592 /** @var array{cell: string} $cellAddress */
593 593 $testSheet->getCell($cellAddress['cell']);
@@ -1009,9 +1009,9 @@
1009 1009 $returnMatrix = [];
1010 1010 $pad = $rpad = ', ';
1011 1011 foreach ($value as $row) {
1012 1012 if (is_array($row)) {
1013 - $returnMatrix[] = implode($pad, array_map([$this, 'showValue'], $row)); // @phpstan-ignore-line
1013 + $returnMatrix[] = implode($pad, array_map([$this, 'showValue'], $row)); // @phpstan-ignore argument.type (array_map can theoretically return array<mixed> not array<string>)
1014 1014 $rpad = '; ';
1015 1015 } else {
1016 1016 $returnMatrix[] = $this->showValue($row);
1017 1017 }
@@ -1564,9 +1564,9 @@
1564 1564 $val = "{$rangeWS2}{$endRowColRef}{$val}";
1565 1565 } elseif (ctype_alpha($val) && strlen($val) <= 3) {
1566 1566 // Column range
1567 1567 $stackItemType = 'Column Reference';
1568 - $endRowColRef = ($refSheet !== null) ? $refSheet->getHighestDataRow($val) : AddressRange::MAX_ROW; // Max 1,048,576 rows for Excel2007
1568 + $endRowColRef = ($refSheet !== null) ? $refSheet->getHighestDataRow() : AddressRange::MAX_ROW; // Max 1,048,576 rows for Excel2007
1569 1569 $val = "{$rangeWS2}{$val}{$endRowColRef}";
1570 1570 }
1571 1571 $stackItemReference = $val;
1572 1572 }
@@ -1590,9 +1590,9 @@
1590 1590 $stackItemType = 'Row Reference';
1591 1591 // unescape any apostrophes or double quotes in worksheet name
1592 1592 $val = str_replace(["''", '""'], ["'", '"'], $val);
1593 1593 $column = 'A';
1594 - if (($testPrevOp !== null && $testPrevOp['value'] === ':') && $pCellParent !== null) { // @phpstan-ignore-line
1594 + if (($testPrevOp !== null && $testPrevOp['value'] === ':') && $pCellParent !== null) { // @phpstan-ignore booleanAnd.alwaysFalse (testPrevop must be non-null), booleanAnd.alwaysFalse (ditto), identical.alwaysFalse (ditto)
1595 1595 $column = $pCellParent->getHighestDataColumn($val);
1596 1596 }
1597 1597 $val = "{$rowRangeReference[2]}{$column}{$rowRangeReference[7]}";
1598 1598 $stackItemReference = $val;
@@ -1604,9 +1604,9 @@
1604 1604 $stackItemType = 'Column Reference';
1605 1605 // unescape any apostrophes or double quotes in worksheet name
1606 1606 $val = str_replace(["''", '""'], ["'", '"'], $val);
1607 1607 $row = '1';
1608 - if (($testPrevOp !== null && $testPrevOp['value'] === ':') && $pCellParent !== null) { // @phpstan-ignore-line
1608 + if (($testPrevOp !== null && $testPrevOp['value'] === ':') && $pCellParent !== null) { // @phpstan-ignore booleanAnd.alwaysFalse (testPrevOp must be non-null?), booleanAnd.alwaysFalse (ditto), identical.alwaysFalse (ditto)
1609 1609 $row = $pCellParent->getHighestDataRow($val);
1610 1610 }
1611 1611 $val = "{$val}{$row}";
1612 1612 $stackItemReference = $val;
@@ -1756,9 +1756,9 @@
1756 1756 // Loop through each token in turn
1757 1757 foreach ($tokens as $tokenIdx => $tokenData) {
1758 1758 /** @var mixed[] $tokenData */
1759 1759 $this->processingAnchorArray = false;
1760 - if ($tokenData['type'] === 'Cell Reference' && isset($tokens[$tokenIdx + 1]) && $tokens[$tokenIdx + 1]['type'] === 'Operand Count for Function ANCHORARRAY()') { //* @phpstan-ignore-line
1760 + if ($tokenData['type'] === 'Cell Reference' && isset($tokens[$tokenIdx + 1]) && $tokens[$tokenIdx + 1]['type'] === 'Operand Count for Function ANCHORARRAY()') { //* @phpstan-ignore offsetAccess.nonOffsetAccessible ($tokens might be mixed not array)
1761 1761 $this->processingAnchorArray = true;
1762 1762 }
1763 1763 $token = $tokenData['value'];
1764 1764 // Branch pruning: skip useless resolutions
@@ -1858,9 +1858,9 @@
1858 1858 } else {
1859 1859 return $this->raiseFormulaError($e->getMessage(), $e->getCode(), $e);
1860 1860 }
1861 1861 }
1862 - } elseif (!is_numeric($token) && !is_object($token) && isset($token, self::BINARY_OPERATORS[$token])) { //* @phpstan-ignore-line
1862 + } elseif (!is_numeric($token) && !is_object($token) && isset($token, self::BINARY_OPERATORS[$token])) { //* @phpstan-ignore offsetAccess.invalidOffset ($token is mixed)
1863 1863 // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
1864 1864 // We must have two operands, error if we don't
1865 1865 $operand2Data = $stack->pop();
1866 1866 if ($operand2Data === null) {
@@ -2047,9 +2047,9 @@
2047 2047 $result = $operand1;
2048 2048 } elseif (Information\ErrorValue::isError($operand2)) {
2049 2049 $result = $operand2;
2050 2050 } else {
2051 - $result = str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($operand1) . self::unwrapResult($operand2)); //* @phpstan-ignore-line
2051 + $result = str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($operand1) . self::unwrapResult($operand2)); //* @phpstan-ignore binaryOp.invalid (unwrapresult can return mixed rather than string)
2052 2052 $result = StringHelper::substring(
2053 2053 $result,
2054 2054 0,
2055 2055 DataType::MAX_STRING_LENGTH
@@ -2080,10 +2080,10 @@
2080 2080 if (count(Functions::flattenArray($cellIntersect)) === 0) {
2081 2081 $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($cellIntersect));
2082 2082 $stack->push('Error', ExcelError::null(), null);
2083 2083 } else {
2084 - $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' // @phpstan-ignore-line
2085 - . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow); // @phpstan-ignore-line
2084 + $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' // @phpstan-ignore argument.type ($oCol or $oRow might be empty), argument.type (ditto)
2085 + . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow); // @phpstan-ignore argument.type ($oCol or $oRow might be empty), argument.type (ditto)
2086 2086 $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($cellIntersect));
2087 2087 $stack->push('Value', $cellIntersect, $cellRef);
2088 2088 }
2089 2089
@@ -2096,15 +2096,15 @@
2096 2096 $stack->push('Value', $cellUnion, 'A1');
2097 2097
2098 2098 break;
2099 2099 }
2100 - } elseif (($token === '~') || ($token === '%')) { // @phpstan-ignore-line
2100 + } elseif (($token === '~') || ($token === '%')) { // @phpstan-ignore booleanOr.alwaysFalse (phpstan says token can't be plain string), identical.alwaysFalse (ditto), identical.alwaysFalse (ditto)
2101 2101 // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
2102 2102 if (($arg = $stack->pop()) === null) {
2103 2103 return $this->raiseFormulaError('Internal error - Operand value missing from stack');
2104 2104 }
2105 2105 $arg = $arg['value'];
2106 - if ($token === '~') { // @phpstan-ignore-line
2106 + if ($token === '~') { // @phpstan-ignore identical.alwaysFalse (phpstan says token can't be plain string)
2107 2107 $this->debugLog->writeDebugLog('Evaluating Negation of %s', $this->showValue($arg));
2108 2108 $multiplier = -1;
2109 2109 } else {
2110 2110 $this->debugLog->writeDebugLog('Evaluating Percentile of %s', $this->showValue($arg));
@@ -2276,9 +2276,9 @@
2276 2276 $arg = $stack->pop();
2277 2277 $a = $argCount - $i - 1;
2278 2278 if (
2279 2279 ($passByReference)
2280 - && (isset($phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) //* @phpstan-ignore-line
2280 + && (isset($phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) //* @phpstan-ignore offsetAccess.nonOffsetAccessible (possibly need to pass 2 arguments to isset)
2281 2281 && ($phpSpreadsheetFunctions[$functionName]['passByReference'][$a])
2282 2282 ) {
2283 2283 /** @var mixed[] $arg */
2284 2284 if ($arg['reference'] === null) {
@@ -2343,9 +2343,9 @@
2343 2343
2344 2344 if ($functionName !== 'MKMATRIX') {
2345 2345 if ($this->debugLog->getWriteDebugLog()) {
2346 2346 krsort($argArrayVals);
2347 - $this->debugLog->writeDebugLog('Evaluating %s ( %s )', self::localeFunc($functionName), implode(self::$localeArgumentSeparator . ' ', Functions::flattenArray($argArrayVals))); // @phpstan-ignore-line
2347 + $this->debugLog->writeDebugLog('Evaluating %s ( %s )', self::localeFunc($functionName), implode(self::$localeArgumentSeparator . ' ', Functions::flattenArray($argArrayVals))); // @phpstan-ignore argument.type (flattenArray returns array<mixed> rather than array<string>)
2348 2348 }
2349 2349 }
2350 2350
2351 2351 // Process the argument with the appropriate function call
@@ -2388,9 +2388,9 @@
2388 2388 if (isset($storeKey)) {
2389 2389 $branchStore[$storeKey] = self::EXCEL_CONSTANTS[$excelConstant];
2390 2390 }
2391 2391 $this->debugLog->writeDebugLog('Evaluating Constant %s as %s', $excelConstant, $this->showTypeDetails(self::EXCEL_CONSTANTS[$excelConstant]));
2392 - } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == self::FORMULA_STRING_QUOTE) || ($token[0] == '#')) { //* @phpstan-ignore-line
2392 + } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == self::FORMULA_STRING_QUOTE) || ($token[0] == '#')) { //* @phpstan-ignore function.alreadyNarrowedType (phpstan says is_bool has argument of *NEVER*?), equal.alwaysFalse (ditto)
2393 2393 /** @var array{type: string, reference: ?string} $tokenData */
2394 2394 $stack->push($tokenData['type'], $token, $tokenData['reference']);
2395 2395 if (isset($storeKey)) {
2396 2396 $branchStore[$storeKey] = $token;