diff --git a/infra/DocumentGenerator.php b/infra/DocumentGenerator.php index 5a86d1778..f31d64892 100644 --- a/infra/DocumentGenerator.php +++ b/infra/DocumentGenerator.php @@ -52,6 +52,7 @@ class DocumentGenerator return rtrim($result, ' '); } + /** @param array|scalar $functionCall */ private static function getPhpSpreadsheetFunctionText(mixed $functionCall): string { if (is_string($functionCall)) { diff --git a/infra/LocaleGenerator.php b/infra/LocaleGenerator.php index dc16e7c5c..66e0fa0b0 100644 --- a/infra/LocaleGenerator.php +++ b/infra/LocaleGenerator.php @@ -283,7 +283,7 @@ class LocaleGenerator foreach ($cells as $cell) { if ($this->localeCanBeSupported($translationWorksheet, $cell)) { $languageNameMap[$cell->getColumn()] = $cell->getValue(); - $this->log($cell->getColumn() . ' -> ' . $cell->getValue()); + $this->log($cell->getColumn() . ' -> ' . $cell->getValueString()); } } } @@ -316,7 +316,7 @@ class LocaleGenerator $cells->setIterateOnlyExistingCells(true); foreach ($cells as $cell) { if ($cell->getValue() != '') { - $this->log($cell->getRow() . ' -> ' . $cell->getValue()); + $this->log($cell->getRow() . ' -> ' . $cell->getValueString()); $this->errorCodeMap[$cell->getValue()] = $cell->getRow(); } } @@ -334,7 +334,7 @@ class LocaleGenerator foreach ($cells as $cell) { if ($this->isFunctionCategoryEntry($cell)) { if (!empty($cell->getValue())) { - $this->log('CATEGORY: ' . $cell->getValue()); + $this->log('CATEGORY: ' . $cell->getValueString()); $this->functionNameMap[$cell->getValue()] = $cell->getRow(); } @@ -345,7 +345,7 @@ class LocaleGenerator $this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE')); $this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow(); } else { - $this->log($cell->getRow() . ' -> ' . $cell->getValue()); + $this->log($cell->getRow() . ' -> ' . $cell->getValueString()); $this->functionNameMap[$cell->getValue()] = $cell->getRow(); } } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 364905f71..9530d4e71 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,2 +1,1969 @@ parameters: ignoreErrors: + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/BESSELI.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/BESSELJ.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/BESSELK.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/BESSELY.php + + - + message: '#^Binary operation "\." between ''\(A1\)\: Unit of…''\|''\(A2\)\: Unit of…''\|''\(A3\)\: Unit of…''\|''\(A4\)\: Unit of…''\|''\(A5\)\: Unit of…''\|''\(A6\)\: Unit of…''\|''\(A7\)\: Unit of…''\|''\(A8\)\: Unit of…''\|''\(A9\)\: Unit of…'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/CONVERT.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 6 + path: samples/Engineering/CONVERT.php + + - + message: '#^Parameter \#1 \$string of function htmlentities expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: samples/Engineering/Convert-Online.php + + - + message: '#^Parameter \#2 \$fromUOM of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering\\ConvertUOM\:\:CONVERT\(\) expects array\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: samples/Engineering/Convert-Online.php + + - + message: '#^Parameter \#3 \$toUOM of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering\\ConvertUOM\:\:CONVERT\(\) expects array\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: samples/Engineering/Convert-Online.php + + - + message: '#^Binary operation "\." between ''\(E1\)\: Compare…''\|''\(E2\)\: Compare…''\|''\(E3\)\: Compare…'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/DELTA.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: samples/Engineering/DELTA.php + + - + message: '#^Binary operation "\." between ''\(C1\)\: ''\|''\(C2\)\: ''\|''\(C3\)\: ''\|''\(C4\)\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/ERF.php + + - + message: '#^Binary operation "\." between ''\(C5\)\: ''\|''\(C6\)\: ''\|''\(C7\)\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/ERF.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 5 + path: samples/Engineering/ERF.php + + - + message: '#^Binary operation "\." between ''\(E1\)\: ''\|''\(E2\)\: ''\|''\(E3\)\: ''\|''\(E4\)\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/Engineering/ERFC.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: samples/Engineering/ERFC.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Binary ''\|''\(B10\)\: Binary ''\|''\(B2\)\: Binary ''\|''\(B3\)\: Binary ''\|''\(B4\)\: Binary ''\|''\(B5\)\: Binary ''\|''\(B6\)\: Binary ''\|''\(B7\)\: Binary ''\|''\(B8\)\: Binary ''\|''\(B9\)\: Binary '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/BIN2DEC.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/BIN2DEC.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Binary ''\|''\(B10\)\: Binary ''\|''\(B2\)\: Binary ''\|''\(B3\)\: Binary ''\|''\(B4\)\: Binary ''\|''\(B5\)\: Binary ''\|''\(B6\)\: Binary ''\|''\(B7\)\: Binary ''\|''\(B8\)\: Binary ''\|''\(B9\)\: Binary '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/BIN2HEX.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/BIN2HEX.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Binary ''\|''\(B10\)\: Binary ''\|''\(B2\)\: Binary ''\|''\(B3\)\: Binary ''\|''\(B4\)\: Binary ''\|''\(B5\)\: Binary ''\|''\(B6\)\: Binary ''\|''\(B7\)\: Binary ''\|''\(B8\)\: Binary ''\|''\(B9\)\: Binary '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/BIN2OCT.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/BIN2OCT.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Decimal ''\|''\(B10\)\: Decimal ''\|''\(B11\)\: Decimal ''\|''\(B2\)\: Decimal ''\|''\(B3\)\: Decimal ''\|''\(B4\)\: Decimal ''\|''\(B5\)\: Decimal ''\|''\(B6\)\: Decimal ''\|''\(B7\)\: Decimal ''\|''\(B8\)\: Decimal ''\|''\(B9\)\: Decimal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/DEC2BIN.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/DEC2BIN.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Decimal ''\|''\(B10\)\: Decimal ''\|''\(B11\)\: Decimal ''\|''\(B12\)\: Decimal ''\|''\(B2\)\: Decimal ''\|''\(B3\)\: Decimal ''\|''\(B4\)\: Decimal ''\|''\(B5\)\: Decimal ''\|''\(B6\)\: Decimal ''\|''\(B7\)\: Decimal ''\|''\(B8\)\: Decimal ''\|''\(B9\)\: Decimal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/DEC2HEX.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/DEC2HEX.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Decimal ''\|''\(B10\)\: Decimal ''\|''\(B11\)\: Decimal ''\|''\(B12\)\: Decimal ''\|''\(B2\)\: Decimal ''\|''\(B3\)\: Decimal ''\|''\(B4\)\: Decimal ''\|''\(B5\)\: Decimal ''\|''\(B6\)\: Decimal ''\|''\(B7\)\: Decimal ''\|''\(B8\)\: Decimal ''\|''\(B9\)\: Decimal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/DEC2OCT.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/DEC2OCT.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Hexadecimal ''\|''\(B10\)\: Hexadecimal ''\|''\(B2\)\: Hexadecimal ''\|''\(B3\)\: Hexadecimal ''\|''\(B4\)\: Hexadecimal ''\|''\(B5\)\: Hexadecimal ''\|''\(B6\)\: Hexadecimal ''\|''\(B7\)\: Hexadecimal ''\|''\(B8\)\: Hexadecimal ''\|''\(B9\)\: Hexadecimal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/HEX2BIN.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/HEX2BIN.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Hexadecimal ''\|''\(B10\)\: Hexadecimal ''\|''\(B11\)\: Hexadecimal ''\|''\(B12\)\: Hexadecimal ''\|''\(B2\)\: Hexadecimal ''\|''\(B3\)\: Hexadecimal ''\|''\(B4\)\: Hexadecimal ''\|''\(B5\)\: Hexadecimal ''\|''\(B6\)\: Hexadecimal ''\|''\(B7\)\: Hexadecimal ''\|''\(B8\)\: Hexadecimal ''\|''\(B9\)\: Hexadecimal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/HEX2DEC.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/HEX2DEC.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Hexadecimal ''\|''\(B10\)\: Hexadecimal ''\|''\(B2\)\: Hexadecimal ''\|''\(B3\)\: Hexadecimal ''\|''\(B4\)\: Hexadecimal ''\|''\(B5\)\: Hexadecimal ''\|''\(B6\)\: Hexadecimal ''\|''\(B7\)\: Hexadecimal ''\|''\(B8\)\: Hexadecimal ''\|''\(B9\)\: Hexadecimal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/HEX2OCT.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/HEX2OCT.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Octal ''\|''\(B10\)\: Octal ''\|''\(B11\)\: Octal ''\|''\(B2\)\: Octal ''\|''\(B3\)\: Octal ''\|''\(B4\)\: Octal ''\|''\(B5\)\: Octal ''\|''\(B6\)\: Octal ''\|''\(B7\)\: Octal ''\|''\(B8\)\: Octal ''\|''\(B9\)\: Octal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/OCT2BIN.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/OCT2BIN.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Octal ''\|''\(B10\)\: Octal ''\|''\(B11\)\: Octal ''\|''\(B12\)\: Octal ''\|''\(B13\)\: Octal ''\|''\(B2\)\: Octal ''\|''\(B3\)\: Octal ''\|''\(B4\)\: Octal ''\|''\(B5\)\: Octal ''\|''\(B6\)\: Octal ''\|''\(B7\)\: Octal ''\|''\(B8\)\: Octal ''\|''\(B9\)\: Octal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/OCT2DEC.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/OCT2DEC.php + + - + message: '#^Binary operation "\." between ''\(B1\)\: Octal ''\|''\(B10\)\: Octal ''\|''\(B11\)\: Octal ''\|''\(B12\)\: Octal ''\|''\(B13\)\: Octal ''\|''\(B2\)\: Octal ''\|''\(B3\)\: Octal ''\|''\(B4\)\: Octal ''\|''\(B5\)\: Octal ''\|''\(B6\)\: Octal ''\|''\(B7\)\: Octal ''\|''\(B8\)\: Octal ''\|''\(B9\)\: Octal '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/OCT2HEX.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/HexEtcConversions/OCT2HEX.php + + - + message: '#^Binary operation "\." between ''A1\: ''\|''A2\: ''\|''A3\: ''\|''A4\: ''\|''A5\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/ADDRESS.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/ADDRESS.php + + - + message: '#^Binary operation "\." between ''A1\: ''\|''A2\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/COLUMN.php + + - + message: '#^Binary operation "\." between ''F1\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/COLUMN.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: samples/LookupRef/COLUMN.php + + - + message: '#^Binary operation "\." between ''A1\: ''\|''A2\: ''\|''A3\: ''\|''A4\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/COLUMNS.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/COLUMNS.php + + - + message: '#^Binary operation "\." between ''A11\: ''\|''A12\: ''\|''A13\: ''\|''A14\: ''\|''A15\: ''\|''A16\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/INDEX.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/INDEX.php + + - + message: '#^Binary operation "\." between ''A1\: ''\|''A2\: ''\|''A3\: ''\|''A4\: ''\|''A5\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/INDIRECT.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/INDIRECT.php + + - + message: '#^Binary operation "\." between ''H1\: ''\|''H2\: ''\|''H3\: ''\|''H4\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/OFFSET.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/OFFSET.php + + - + message: '#^Binary operation "\." between ''A1\: ''\|''A2\: ''\|''A3\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/ROW.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/ROW.php + + - + message: '#^Binary operation "\." between ''A1\: ''\|''A2\: ''\|''A3\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/ROWS.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/ROWS.php + + - + message: '#^Binary operation "\." between literal\-string&non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/VLOOKUP.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: samples/LookupRef/VLOOKUP.php + + - + message: '#^Parameter \#1 \$string of function htmlentities expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: samples/Wizards/NumberFormat/Accounting.php + + - + message: '#^Parameter \#1 \$string of function htmlentities expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: samples/Wizards/NumberFormat/Currency.php + + - + message: '#^Parameter \#1 \$string of function htmlentities expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: samples/Wizards/NumberFormat/Number.php + + - + message: '#^Parameter \#1 \$string of function htmlentities expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: samples/Wizards/NumberFormat/Percentage.php + + - + message: '#^Parameter \#1 \$string of function htmlentities expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: samples/Wizards/NumberFormat/Scientific.php + + - + message: '#^Parameter \#1 \$str1 of static method PhpOffice\\PhpSpreadsheet\\Calculation\\BinaryComparison\:\:strcmpAllowNull\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/BinaryComparison.php + + - + message: '#^Parameter \#1 \$str1 of static method PhpOffice\\PhpSpreadsheet\\Calculation\\BinaryComparison\:\:strcmpLowercaseFirst\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/BinaryComparison.php + + - + message: '#^Parameter \#2 \$str2 of static method PhpOffice\\PhpSpreadsheet\\Calculation\\BinaryComparison\:\:strcmpAllowNull\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/BinaryComparison.php + + - + message: '#^Parameter \#2 \$str2 of static method PhpOffice\\PhpSpreadsheet\\Calculation\\BinaryComparison\:\:strcmpLowercaseFirst\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/BinaryComparison.php + + - + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 4 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\*" between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\*\*" between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\*\=" between mixed and \-1\|0\.01 results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\*\=" between mixed and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\+" between mixed and 1 results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\+" between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\+\=" between mixed and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\-" between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\-\=" between mixed and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between ''Pruned branch \(only…'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between ''a '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between ''a boolean with a…''\|''a floating point…''\|''a matrix with a…''\|''a string with a…''\|''an integer number…'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between ''onlyIf\-'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 4 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between ''onlyIfNot\-'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 4 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "/" between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Binary operation "/\=" between mixed and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset ''onlyIf'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset ''onlyIfNot'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset ''reference'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 3 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset ''storeKey'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset ''type'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 3 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset ''value'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset \(float\|int\) on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset \(int\|string\) on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset 0 on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 4 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset int\<0, max\> on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 41 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset mixed on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot call method push\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation\:\:makeError\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$array of function array_intersect_key expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$branchPruningEnabled of class PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\BranchPruner constructor expects bool, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$columnAddress of static method PhpOffice\\PhpSpreadsheet\\Cell\\Coordinate\:\:columnIndexFromString\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$formula of method PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation\:\:_calculateFormulaValue\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$matrix of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation\:\:getMatrixDimensions\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$operand of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\FormattedNumber\:\:convertToNumberIfFormatted\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$string of function strtoupper expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$type of method PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack\:\:push\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#1 \$worksheetName of method PhpOffice\\PhpSpreadsheet\\Spreadsheet\:\:getSheetByName\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#2 \.\.\.\$arrays of function array_intersect_key expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#3 \$reference of method PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack\:\:push\(\) expects string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#3 \$subject of function preg_replace_callback expects array\\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter \#3 \$subject of function str_replace expects array\\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Parameter &\$stack by\-ref type of method PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation\:\:executeNumericBinaryOperation\(\) expects PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack, mixed given\.$#' + identifier: parameterByRef.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Part \$token \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 2 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Property PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation\:\:\$branchPruningEnabled \(bool\) does not accept mixed\.$#' + identifier: assign.propertyType + count: 1 + path: src/PhpSpreadsheet/Calculation/Calculation.php + + - + message: '#^Cannot access offset int\|string\|null on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#1 \$array of function array_keys expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#1 \$callback of function array_map expects \(callable\(mixed\)\: mixed\)\|null, ''strtoupper'' given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#1 \$criteriaNames of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Database\\DatabaseAbstract\:\:buildQuery\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#1 \$string of function strtoupper expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#2 \$array of function array_map expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#3 \$criteria of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Database\\DatabaseAbstract\:\:executeQuery\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Parameter \#4 \$fields of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Database\\DatabaseAbstract\:\:executeQuery\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php + + - + message: '#^Parameter \#1 \$day of static method PhpOffice\\PhpSpreadsheet\\Shared\\Date\:\:dayStringToNumber\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php + + - + message: '#^Parameter \#1 \$monthName of static method PhpOffice\\PhpSpreadsheet\\Shared\\Date\:\:monthStringToNumber\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 3 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php + + - + message: '#^Parameter \#1 \$dateValue of static method PhpOffice\\PhpSpreadsheet\\Calculation\\DateTimeExcel\\DateValue\:\:fromString\(\) expects array\|bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php + + - + message: '#^Parameter \#1 \$excelTimestamp of static method PhpOffice\\PhpSpreadsheet\\Shared\\Date\:\:excelToDateTimeObject\(\) expects float\|int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php + + - + message: '#^Parameter \#1 \$timeValue of static method PhpOffice\\PhpSpreadsheet\\Calculation\\DateTimeExcel\\Helpers\:\:getTimeValue\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php + + - + message: '#^Binary operation "/" between mixed and 360 results in an error\.$#' + identifier: binaryOp.invalid + count: 3 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php + + - + message: '#^Binary operation "/" between mixed and 365 results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php + + - + message: '#^Binary operation "/" between mixed and float\|int results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php + + - + message: '#^Parameter &\$operand by\-ref type of method PhpOffice\\PhpSpreadsheet\\Calculation\\Engine\\FormattedNumber\:\:convertToNumberIfFraction\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php + + - + message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Engine/Logger.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php + + - + message: '#^Parameter \#1 \$year of static method PhpOffice\\PhpSpreadsheet\\Calculation\\DateTimeExcel\\Helpers\:\:isLeapYear\(\) expects int\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Amortization.php + + - + message: '#^Binary operation "\+" between 1 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Binary operation "\-" between \-1 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\CashFlow\\Variable\\NonPeriodic\:\:xnpvOrdered\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Parameter \#1 \$values of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\CashFlow\\Variable\\NonPeriodic\:\:xirrBisection\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Parameter \#1 \$values of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\CashFlow\\Variable\\NonPeriodic\:\:xirrPart3\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Parameter \#2 \$dates of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\CashFlow\\Variable\\NonPeriodic\:\:xirrBisection\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Parameter \#2 \$dates of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\CashFlow\\Variable\\NonPeriodic\:\:xirrPart3\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Parameter \#2 \$values of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\CashFlow\\Variable\\NonPeriodic\:\:xnpvOrdered\(\) expects array\, mixed given\.$#' + identifier: argument.type + count: 7 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php + + - + message: '#^Binary operation "\+" between 1 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + + - + message: '#^Binary operation "\+" between 1\.0 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + + - + message: '#^Binary operation "\+" between mixed and float results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + + - + message: '#^Binary operation "\+\=" between mixed and float results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + + - + message: '#^Binary operation "\-" between float and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + + - + message: '#^Binary operation "\-" between mixed and float results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + + - + message: '#^Parameter \#1 \$year of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Helpers\:\:daysPerYear\(\) expects int\|string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Financial/Coupons.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\AccruedInterest\:\:atMaturity\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\AccruedInterest\:\:periodic\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Price\:\:priceAtMaturity\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Price\:\:priceDiscounted\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Price\:\:received\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + + - + message: '#^Parameter \#1 \$year of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Helpers\:\:daysPerYear\(\) expects int\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Rates\:\:discount\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Rates\:\:interest\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Yields\:\:yieldAtMaturity\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Securities\\Yields\:\:yieldDiscounted\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php + + - + message: '#^Parameter \#1 \$year of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Helpers\:\:daysPerYear\(\) expects int\|string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php + + - + message: '#^Parameter \#1 \$year of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Financial\\Helpers\:\:daysPerYear\(\) expects int\|string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php + + - + message: '#^Binary operation "\." between ''\='' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Binary operation "\." between string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#1 \$dateValue of static method PhpOffice\\PhpSpreadsheet\\Shared\\Date\:\:stringToExcel\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#1 \$haystack of function substr_count expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#1 \$string of function rtrim expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#1 \$string of function strtoupper expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#1 \$string of function trim expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#3 \$subject of function preg_replace expects array\\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Parameter \#3 \$subject of function str_replace expects array\\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Functions.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Information\\Value\:\:asNumber\(\) should return float\|int\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Parameter \#1 \$coordinate of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Functions\:\:trimSheetFromCellReference\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Parameter \#1 \$coordinate of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Functions\:\:trimTrailingRange\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Parameter \#1 \$haystack of function str_contains expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Parameter \#1 \$namedRange of method PhpOffice\\PhpSpreadsheet\\Spreadsheet\:\:getNamedRange\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Parameter \#1 \$num1 of function fmod expects float, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/Information/Value.php + + - + message: '#^Parameter \#1 \$row of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:formatAsA1\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Parameter \#1 \$row of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:formatAsR1C1\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Parameter \#1 \$sheetName of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:sheetName\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Parameter \#2 \$column of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:formatAsA1\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Parameter \#2 \$column of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:formatAsR1C1\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Parameter \#3 \$relativity of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:formatAsA1\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Parameter \#3 \$relativity of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Address\:\:formatAsR1C1\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php + + - + message: '#^Cannot use \+\+ on mixed\.$#' + identifier: preInc.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Formula\:\:text\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Formula.php + + - + message: '#^Parameter \#1 \$coordinate of method PhpOffice\\PhpSpreadsheet\\Worksheet\\Worksheet\:\:cellExists\(\) expects array\{int, int\}\|PhpOffice\\PhpSpreadsheet\\Cell\\CellAddress\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Formula.php + + - + message: '#^Parameter \#1 \$coordinate of method PhpOffice\\PhpSpreadsheet\\Worksheet\\Worksheet\:\:getCell\(\) expects array\{int, int\}\|PhpOffice\\PhpSpreadsheet\\Cell\\CellAddress\|string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/LookupRef/Formula.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Formula.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php + + - + message: '#^Parameter \#1 \$lookupArray of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\HLookup\:\:convertLiteralArray\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php + + - + message: '#^Parameter \#2 \$index_number of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\LookupBase\:\:validateIndexLookup\(\) expects float\|int\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Hyperlink\:\:set\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php + + - + message: '#^Parameter \#1 \$string of function trim expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php + + - + message: '#^Parameter \#1 \$tooltip of method PhpOffice\\PhpSpreadsheet\\Cell\\Hyperlink\:\:setTooltip\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php + + - + message: '#^Parameter \#1 \$url of method PhpOffice\\PhpSpreadsheet\\Cell\\Hyperlink\:\:setUrl\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php + + - + message: '#^Parameter \#1 \$lookupVector of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Lookup\:\:verifyLookupValues\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php + + - + message: '#^Parameter \#1 \$resultVector of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Lookup\:\:verifyResultVector\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php + + - + message: '#^Parameter \#2 \$resultVector of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Lookup\:\:verifyLookupValues\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php + + - + message: '#^Parameter \#1 \$message of class PhpOffice\\PhpSpreadsheet\\Calculation\\Exception constructor expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php + + - + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php + + - + message: '#^Cannot access offset int\|string on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php + + - + message: '#^Parameter \#1 \$array of function array_keys expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php + + - + message: '#^Binary operation "\+\=" between int and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php + + - + message: '#^Binary operation "\+\=" between mixed and int results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php + + - + message: '#^Binary operation "\-" between mixed and 1 results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 4 + path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php + + - + message: '#^Parameter \#1 \$sortIndex of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Sort\:\:validateArrayArgumentsForSort\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Sort.php + + - + message: '#^Parameter \#3 \$sortOrder of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Sort\:\:sortByColumn\(\) expects array\, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Sort.php + + - + message: '#^Parameter \#3 \$sortOrder of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\Sort\:\:sortByRow\(\) expects array\, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/Sort.php + + - + message: '#^Cannot access offset \(int\|string\) on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Cannot access offset int on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Cannot access offset int\|string\|null on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Parameter \#1 \$array of function array_keys expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Parameter \#1 \$array of function uasort expects TArray of array\, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Parameter \#1 \$lookup_array of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\LookupBase\:\:validateIndexLookup\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Parameter \#2 \$index_number of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\LookupBase\:\:validateIndexLookup\(\) expects float\|int\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Parameter \#2 \$lookupArray of static method PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef\\VLookup\:\:vLookupSearch\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php + + - + message: '#^Cannot call method getWorksheet\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig\\Subtotal\:\:evaluate\(\) should return float\|int\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php + + - + message: '#^Parameter \#1 \$array of function array_filter expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php + + - + message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php + + - + message: '#^Binary operation "\+\=" between \(float\|int\) and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Averages.php + + - + message: '#^Binary operation "\-" between mixed and float\|int\|string results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Averages.php + + - + message: '#^Parameter \#2 \$condition of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Conditional\:\:AVERAGEIF\(\) expects array\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Confidence\:\:CONFIDENCE\(\) should return array\|float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Confidence.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Distributions\\ChiSquared\:\:test\(\) should return float\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php + + - + message: '#^Parameter \#1 \$value of function count expects array\|Countable, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php + + - + message: '#^Binary operation "\*" between 2 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php + + - + message: '#^Binary operation "\+" between 1 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php + + - + message: '#^Binary operation "\-" between 1 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php + + - + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getCorrelation\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getCovariance\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getDFResiduals\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getF\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getGoodnessOfFit\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getIntersect\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getIntersectSE\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getSSRegression\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getSSResiduals\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getSlope\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getSlopeSE\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getStdevOfResiduals\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getValueOfYForX\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Cannot call method getXValues\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Parameter \#1 \$yValues of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Trends\:\:validateTrendArrays\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 9 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Parameter \#2 \$xValues of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Trends\:\:validateTrendArrays\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 9 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Parameter \#2 \$yValues of static method PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\Trend\:\:calculate\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 9 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Parameter \#3 \$xValues of static method PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\Trend\:\:calculate\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 9 + path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\CharacterConvert\:\:unicodeToOrd\(\) should return int but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/CharacterConvert.php + + - + message: '#^Binary operation "\." between mixed and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php + + - + message: '#^Cannot access offset int\<0, max\> on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 11 + path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\Concatenate\:\:concatenate2Args\(\) should return array\|string but returns mixed\.$#' + identifier: return.type + count: 2 + path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php + + - + message: '#^Parameter \#1 \$ignoreEmpty of static method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\Concatenate\:\:evaluateTextJoinArray\(\) expects bool, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php + + - + message: '#^Parameter \#1 \$separator of function implode expects array\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 6 + path: src/PhpSpreadsheet/Calculation/TextData/Extract.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\Extract\:\:validateTextBeforeAfter\(\) should return array\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Extract.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 3 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\Format\:\:VALUE\(\) should return array\|DateTimeInterface\|float\|int\|string but returns mixed\.$#' + identifier: return.type + count: 2 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#1 \$dateValue of static method PhpOffice\\PhpSpreadsheet\\Calculation\\DateTimeExcel\\DateValue\:\:fromString\(\) expects array\|bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#1 \$haystack of function str_contains expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#1 \$haystack of function strpos expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#1 \$string of function trim expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#1 \$timeValue of static method PhpOffice\\PhpSpreadsheet\\Calculation\\DateTimeExcel\\TimeValue\:\:fromString\(\) expects array\|bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#2 \$subject of static method Composer\\Pcre\\Preg\:\:matchAllWithOffsets\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Parameter \#3 \$subject of function str_replace expects array\\|string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/TextData/Format.php + + - + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Helpers.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Helpers.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\Replace\:\:executeSubstitution\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Replace.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 2 + path: src/PhpSpreadsheet/Calculation/TextData/Text.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\TextData\\Text\:\:split\(\) should return array\|string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Text.php + + - + message: '#^Parameter \#1 \$str of function preg_quote expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/TextData/Text.php + + - + message: '#^Parameter \#2 \$subject of static method Composer\\Pcre\\Preg\:\:split\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: src/PhpSpreadsheet/Calculation/TextData/Text.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack\:\:last\(\) should return array\|null but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Token/Stack.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Token\\Stack\:\:pop\(\) should return array\|null but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Token/Stack.php + + - + message: '#^Parameter \#1 \$function of static method PhpOffice\\PhpSpreadsheet\\Calculation\\Calculation\:\:localeFunc\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Calculation/Token/Stack.php + + - + message: '#^Part \$formula \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: src/PhpSpreadsheet/Cell/DataValidator.php + + - + message: '#^Parameter \#1 \$path of function basename expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Helper/Sample.php + + - + message: '#^Binary operation "\." between ''RICH TEXT\: '' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter \#4 \$cellContent of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementBr\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter \#5 \$cellContent of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElement\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter &\$cellContent by\-ref type of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementBr\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter &\$cellContent by\-ref type of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementH1Etc\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 2 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter &\$cellContent by\-ref type of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementHr\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter &\$cellContent by\-ref type of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementLi\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 2 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter &\$cellContent by\-ref type of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementTable\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Parameter &\$cellContent by\-ref type of method PhpOffice\\PhpSpreadsheet\\Reader\\Html\:\:processDomElementThTd\(\) expects string, mixed given\.$#' + identifier: parameterByRef.type + count: 1 + path: src/PhpSpreadsheet/Reader/Html.php + + - + message: '#^Binary operation "\-" between mixed and 1 results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Reader/Xls/LoadSpreadsheet.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Shared\\CodePage\:\:numberToName\(\) should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Shared/CodePage.php + + - + message: '#^Parameter \#2 \$to_encoding of function iconv expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Shared/CodePage.php + + - + message: '#^Cannot access an offset on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Shared/OLE.php + + - + message: '#^Parameter \#1 \$array of function array_keys expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Shared/OLE.php + + - + message: '#^Cannot access offset array\\|string on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot access property \$_file_handle on mixed\.$#' + identifier: property.nonObject + count: 4 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot access property \$bbat on mixed\.$#' + identifier: property.nonObject + count: 1 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot access property \$bigBlockSize on mixed\.$#' + identifier: property.nonObject + count: 3 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot access property \$bigBlockThreshold on mixed\.$#' + identifier: property.nonObject + count: 1 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot access property \$root on mixed\.$#' + identifier: property.nonObject + count: 2 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot access property \$sbat on mixed\.$#' + identifier: property.nonObject + count: 1 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot call method getBlockOffset\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Property PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream\:\:\$ole \(PhpOffice\\PhpSpreadsheet\\Shared\\OLE\|null\) does not accept mixed\.$#' + identifier: assign.propertyType + count: 1 + path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php + + - + message: '#^Cannot clone mixed\.$#' + identifier: clone.nonObject + count: 2 + path: src/PhpSpreadsheet/Shared/OLE/PPS.php + + - + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 1 + path: src/PhpSpreadsheet/Spreadsheet.php + + - + message: '#^Cannot clone non\-object variable \$item of type mixed\.$#' + identifier: clone.nonObject + count: 1 + path: src/PhpSpreadsheet/Spreadsheet.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Spreadsheet\:\:copy\(\) should return PhpOffice\\PhpSpreadsheet\\Spreadsheet but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Spreadsheet.php + + - + message: '#^Method PhpOffice\\PhpSpreadsheet\\Spreadsheet\:\:getRibbonBinObjects\(\) should return array\|null but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/PhpSpreadsheet/Spreadsheet.php + + - + message: '#^Binary operation "\." between ''"'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Style/ConditionalFormatting/CellMatcher.php + + - + message: '#^Binary operation "\*" between 24\|1440\|86400 and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 2 + path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php + + - + message: '#^Parameter \#2 \$replace of function str_replace expects array\\|string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php + + - + message: '#^Binary operation "\*\=" between mixed and int\<1, max\> results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php + + - + message: '#^Cannot clone non\-object variable \$v of type mixed\.$#' + identifier: clone.nonObject + count: 1 + path: src/PhpSpreadsheet/Worksheet/AutoFilter.php + + - + message: '#^Cannot clone non\-object variable \$v of type mixed\.$#' + identifier: clone.nonObject + count: 1 + path: src/PhpSpreadsheet/Worksheet/Table.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Worksheet/Worksheet.php + + - + message: '#^Parameter \#2 \$cellAddress of method PhpOffice\\PhpSpreadsheet\\Writer\\Html\:\:generateRowCellCss\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Writer/Html.php + + - + message: '#^Parameter \#1 \$token of method PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Parser\:\:convert\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Writer/Xls/Parser.php + + - + message: '#^Parameter \#1 \$tree of method PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Parser\:\:toReversePolish\(\) expects array, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Writer/Xls/Parser.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ff4425b7c..279cfdabd 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,7 +7,7 @@ includes: - vendor/phpstan/phpstan-deprecation-rules/rules.neon parameters: - level: 8 + level: 9 paths: - samples/ - src/ diff --git a/samples/Basic/03_Formulas.php b/samples/Basic/03_Formulas.php index e45382310..0163e828c 100644 --- a/samples/Basic/03_Formulas.php +++ b/samples/Basic/03_Formulas.php @@ -28,38 +28,38 @@ $spreadsheet->getActiveSheet()->setCellValue('B1', 'Range #1') ->setCellValue('B3', 7) ->setCellValue('B4', 13) ->setCellValue('B5', '=SUM(B2:B4)'); -$helper->log('Sum of Range #1 is ' . $spreadsheet->getActiveSheet()->getCell('B5')->getCalculatedValue()); +$helper->log('Sum of Range #1 is ' . $spreadsheet->getActiveSheet()->getCell('B5')->getCalculatedValueString()); $spreadsheet->getActiveSheet()->setCellValue('C1', 'Range #2') ->setCellValue('C2', 5) ->setCellValue('C3', 11) ->setCellValue('C4', 17) ->setCellValue('C5', '=SUM(C2:C4)'); -$helper->log('Sum of Range #2 is ' . $spreadsheet->getActiveSheet()->getCell('C5')->getCalculatedValue()); +$helper->log('Sum of Range #2 is ' . $spreadsheet->getActiveSheet()->getCell('C5')->getCalculatedValueString()); $spreadsheet->getActiveSheet() ->setCellValue('A7', 'Total of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B7', '=SUM(B5:C5)'); -$helper->log('Sum of both Ranges is ' . $spreadsheet->getActiveSheet()->getCell('B7')->getCalculatedValue()); +$helper->log('Sum of both Ranges is ' . $spreadsheet->getActiveSheet()->getCell('B7')->getCalculatedValueString()); $spreadsheet->getActiveSheet() ->setCellValue('A8', 'Minimum of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B8', '=MIN(B2:C4)'); -$helper->log('Minimum value in either Range is ' . $spreadsheet->getActiveSheet()->getCell('B8')->getCalculatedValue()); +$helper->log('Minimum value in either Range is ' . $spreadsheet->getActiveSheet()->getCell('B8')->getCalculatedValueString()); $spreadsheet->getActiveSheet() ->setCellValue('A9', 'Maximum of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B9', '=MAX(B2:C4)'); -$helper->log('Maximum value in either Range is ' . $spreadsheet->getActiveSheet()->getCell('B9')->getCalculatedValue()); +$helper->log('Maximum value in either Range is ' . $spreadsheet->getActiveSheet()->getCell('B9')->getCalculatedValueString()); $spreadsheet->getActiveSheet() ->setCellValue('A10', 'Average of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B10', '=AVERAGE(B2:C4)'); -$helper->log('Average value of both Ranges is ' . $spreadsheet->getActiveSheet()->getCell('B10')->getCalculatedValue()); +$helper->log('Average value of both Ranges is ' . $spreadsheet->getActiveSheet()->getCell('B10')->getCalculatedValueString()); $spreadsheet->getActiveSheet() ->getColumnDimension('A') ->setAutoSize(true); diff --git a/samples/Basic1/13_Calculation.php b/samples/Basic1/13_Calculation.php index 3c215315b..688cb9de4 100644 --- a/samples/Basic1/13_Calculation.php +++ b/samples/Basic1/13_Calculation.php @@ -162,7 +162,7 @@ for ($col = 'B'; $col != 'G'; ++$col) { is_string($formula) && ($formula[0] == '=') ) { - $helper->log('Value of ' . $col . $row . ' [' . $formula . ']: ' . $spreadsheet->getActiveSheet()->getCell($col . $row)->getCalculatedValue()); + $helper->log('Value of ' . $col . $row . ' [' . $formula . ']: ' . $spreadsheet->getActiveSheet()->getCell($col . $row)->getCalculatedValueString()); } } } diff --git a/samples/Basic1/13_CalculationCyclicFormulae.php b/samples/Basic1/13_CalculationCyclicFormulae.php index 45a9f5b6a..7e7ea80f0 100644 --- a/samples/Basic1/13_CalculationCyclicFormulae.php +++ b/samples/Basic1/13_CalculationCyclicFormulae.php @@ -27,7 +27,7 @@ for ($row = 1; $row <= 2; ++$row) { is_string($formula) && ($formula[0] == '=') ) { - $helper->log('Value of ' . $col . $row . ' [' . $formula . ']: ' . $spreadsheet->getActiveSheet()->getCell($col . $row)->getCalculatedValue()); + $helper->log('Value of ' . $col . $row . ' [' . $formula . ']: ' . $spreadsheet->getActiveSheet()->getCell($col . $row)->getCalculatedValueString()); } } } diff --git a/samples/Basic1/18_Extendedcalculation.php b/samples/Basic1/18_Extendedcalculation.php index c1ec2c0a4..ba78ddcae 100644 --- a/samples/Basic1/18_Extendedcalculation.php +++ b/samples/Basic1/18_Extendedcalculation.php @@ -64,6 +64,6 @@ $spreadsheet->getActiveSheet()->setCellValue('F14', '=COUNT(B2:C12)'); // Calculated data $helper->log('Calculated data'); -$helper->log('Value of B14 [=COUNT(B2:B12)]: ' . $spreadsheet->getActiveSheet()->getCell('B14')->getCalculatedValue()); +$helper->log('Value of B14 [=COUNT(B2:B12)]: ' . $spreadsheet->getActiveSheet()->getCell('B14')->getCalculatedValueString()); $helper->logEndingNotes(); diff --git a/samples/Basic1/19_Namedrange.php b/samples/Basic1/19_Namedrange.php index 5b1a25270..3ff07abf1 100644 --- a/samples/Basic1/19_Namedrange.php +++ b/samples/Basic1/19_Namedrange.php @@ -61,9 +61,9 @@ $spreadsheet->getActiveSheet()->setCellValue('A1', 'Firstname:') // Resolve range $helper->log('Resolve range'); -$helper->log('Cell B1 {=PersonFN}: ' . $spreadsheet->getActiveSheet()->getCell('B1')->getCalculatedValue()); -$helper->log('Cell B3 {=PersonFN & " " & PersonLN}: ' . $spreadsheet->getActiveSheet()->getCell('B3')->getCalculatedValue()); -$helper->log('Cell Person!B1: ' . $spreadsheet->getActiveSheet()->getCell('Person!B1')->getCalculatedValue()); +$helper->log('Cell B1 {=PersonFN}: ' . $spreadsheet->getActiveSheet()->getCell('B1')->getCalculatedValueString()); +$helper->log('Cell B3 {=PersonFN & " " & PersonLN}: ' . $spreadsheet->getActiveSheet()->getCell('B3')->getCalculatedValueString()); +$helper->log('Cell Person!B1: ' . $spreadsheet->getActiveSheet()->getCell('Person!B1')->getCalculatedValueString()); // Rename worksheet $helper->log('Rename worksheet'); diff --git a/samples/Basic2/28_Iterator.php b/samples/Basic2/28_Iterator.php index 0344db5de..953554af6 100644 --- a/samples/Basic2/28_Iterator.php +++ b/samples/Basic2/28_Iterator.php @@ -27,7 +27,7 @@ foreach ($spreadsheet->getWorksheetIterator() as $worksheet) { $cellIterator = $row->getCellIterator(); $cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set foreach ($cellIterator as $cell) { - $helper->log(' Cell - ' . $cell->getCoordinate() . ' - ' . $cell->getCalculatedValue()); + $helper->log(' Cell - ' . $cell->getCoordinate() . ' - ' . $cell->getCalculatedValueString()); } } } diff --git a/samples/Basic4/45_Quadratic_equation_solver.php b/samples/Basic4/45_Quadratic_equation_solver.php index d681a2109..adc8c714a 100644 --- a/samples/Basic4/45_Quadratic_equation_solver.php +++ b/samples/Basic4/45_Quadratic_equation_solver.php @@ -2,7 +2,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Helper\Sample; -use PhpOffice\PhpSpreadsheet\Settings; +use PhpOffice\PhpSpreadsheet\Shared\StringHelper; require __DIR__ . '/../Header.php'; @@ -12,6 +12,9 @@ if ($helper->isCli()) { return; } +$postA = htmlentities(StringHelper::convertToString($_POST['A'] ?? '')); +$postB = htmlentities(StringHelper::convertToString($_POST['B'] ?? '')); +$postC = htmlentities(StringHelper::convertToString($_POST['C'] ?? '')); ?>
Enter the coefficients for Ax2 + Bx + C = 0 @@ -21,7 +24,7 @@ if ($helper->isCli()) { - + @@ -29,14 +32,14 @@ if ($helper->isCli()) { - + - + @@ -47,19 +50,20 @@ if ($helper->isCli()) { log('Non-numeric input'); - } elseif ($_POST['A'] == 0) { + } elseif ($postA == 0) { $helper->log('The equation is not quadratic'); } else { // Calculate and Display the results $helper->log('
Roots:
'); - $discriminantFormula = '=POWER(' . $_POST['B'] . ',2) - (4 * ' . $_POST['A'] . ' * ' . $_POST['C'] . ')'; + $discriminantFormula = '=POWER(' . $postB . ',2) - (4 * ' . $postA . ' * ' . $postC . ')'; $discriminant = Calculation::getInstance()->calculateFormula($discriminantFormula); + $discriminant = StringHelper::convertToString($discriminant); - $r1Formula = '=IMDIV(IMSUM(-' . $_POST['B'] . ',IMSQRT(' . $discriminant . ')),2 * ' . $_POST['A'] . ')'; - $r2Formula = '=IF(' . $discriminant . '=0,"Only one root",IMDIV(IMSUB(-' . $_POST['B'] . ',IMSQRT(' . $discriminant . ')),2 * ' . $_POST['A'] . '))'; + $r1Formula = '=IMDIV(IMSUM(-' . $postB . ',IMSQRT(' . $discriminant . ')),2 * ' . $postA . ')'; + $r2Formula = '=IF(' . $discriminant . '=0,"Only one root",IMDIV(IMSUB(-' . $postB . ',IMSQRT(' . $discriminant . ')),2 * ' . $postA . '))'; /** @var string */ $output = Calculation::getInstance()->calculateFormula($r1Formula); diff --git a/samples/Bitwise/BITAND.php b/samples/Bitwise/BITAND.php index ad0cc3383..8bfd2f114 100644 --- a/samples/Bitwise/BITAND.php +++ b/samples/Bitwise/BITAND.php @@ -38,17 +38,17 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): Bitwise AND of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() . ') and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . '(' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ') is ' - . $worksheet->getCell('E' . $row)->getCalculatedValue() + . $worksheet->getCell('E' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('F' . $row)->getCalculatedValue() + . $worksheet->getCell('F' . $row)->getCalculatedValueString() . ')' ); } diff --git a/samples/Bitwise/BITLSHIFT.php b/samples/Bitwise/BITLSHIFT.php index 7f5cd979a..fe0b09e36 100644 --- a/samples/Bitwise/BITLSHIFT.php +++ b/samples/Bitwise/BITLSHIFT.php @@ -40,35 +40,35 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): Bitwise Left Shift of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ') by 1 bit is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ')' ); $helper->log( "(E$row): Bitwise Left Shift of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ') by 2 bits is ' - . $worksheet->getCell('E' . $row)->getCalculatedValue() + . $worksheet->getCell('E' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('F' . $row)->getCalculatedValue() + . $worksheet->getCell('F' . $row)->getCalculatedValueString() . ')' ); $helper->log( "(E$row): Bitwise Left Shift of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ') by 3 bits is ' - . $worksheet->getCell('G' . $row)->getCalculatedValue() + . $worksheet->getCell('G' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('H' . $row)->getCalculatedValue() + . $worksheet->getCell('H' . $row)->getCalculatedValueString() . ')' ); } diff --git a/samples/Bitwise/BITOR.php b/samples/Bitwise/BITOR.php index e48d27ce0..39706ac5e 100644 --- a/samples/Bitwise/BITOR.php +++ b/samples/Bitwise/BITOR.php @@ -38,17 +38,17 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): Bitwise OR of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() . ') and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . '(' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ') is ' - . $worksheet->getCell('E' . $row)->getCalculatedValue() + . $worksheet->getCell('E' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('F' . $row)->getCalculatedValue() + . $worksheet->getCell('F' . $row)->getCalculatedValueString() . ')' ); } diff --git a/samples/Bitwise/BITRSHIFT.php b/samples/Bitwise/BITRSHIFT.php index f2f604972..c2f143981 100644 --- a/samples/Bitwise/BITRSHIFT.php +++ b/samples/Bitwise/BITRSHIFT.php @@ -38,35 +38,35 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): Bitwise Right Shift of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ') by 1 bit is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ')' ); $helper->log( "(E$row): Bitwise Right Shift of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ') by 2 bits is ' - . $worksheet->getCell('E' . $row)->getCalculatedValue() + . $worksheet->getCell('E' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('F' . $row)->getCalculatedValue() + . $worksheet->getCell('F' . $row)->getCalculatedValueString() . ')' ); $helper->log( "(E$row): Bitwise Right Shift of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ') by 3 bits is ' - . $worksheet->getCell('G' . $row)->getCalculatedValue() + . $worksheet->getCell('G' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('H' . $row)->getCalculatedValue() + . $worksheet->getCell('H' . $row)->getCalculatedValueString() . ')' ); } diff --git a/samples/Bitwise/BITXOR.php b/samples/Bitwise/BITXOR.php index c4990cebd..61e4aa7a3 100644 --- a/samples/Bitwise/BITXOR.php +++ b/samples/Bitwise/BITXOR.php @@ -38,17 +38,17 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): Bitwise XOR of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' (' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() . ') and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . '(' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ') is ' - . $worksheet->getCell('E' . $row)->getCalculatedValue() + . $worksheet->getCell('E' . $row)->getCalculatedValueString() . ' (' - . $worksheet->getCell('F' . $row)->getCalculatedValue() + . $worksheet->getCell('F' . $row)->getCalculatedValueString() . ')' ); } diff --git a/samples/ComplexNumbers1/COMPLEX.php b/samples/ComplexNumbers1/COMPLEX.php index afd6eefc4..6a6af5f60 100644 --- a/samples/ComplexNumbers1/COMPLEX.php +++ b/samples/ComplexNumbers1/COMPLEX.php @@ -34,8 +34,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(A$row): Formula " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' result is ' - . $worksheet->getCell('A' . $row)->getCalculatedValue() + . $worksheet->getCell('A' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers1/IMABS.php b/samples/ComplexNumbers1/IMABS.php index f0d34364a..3096e1fce 100644 --- a/samples/ComplexNumbers1/IMABS.php +++ b/samples/ComplexNumbers1/IMABS.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The absolute value of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers1/IMAGINARY.php b/samples/ComplexNumbers1/IMAGINARY.php index 2c6cbe4bf..587fe6642 100644 --- a/samples/ComplexNumbers1/IMAGINARY.php +++ b/samples/ComplexNumbers1/IMAGINARY.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The imaginary component of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers1/IMARGUMENT.php b/samples/ComplexNumbers1/IMARGUMENT.php index 24cda68e4..1c100f7b0 100644 --- a/samples/ComplexNumbers1/IMARGUMENT.php +++ b/samples/ComplexNumbers1/IMARGUMENT.php @@ -41,9 +41,9 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Theta Argument of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() . ' radians' ); } diff --git a/samples/ComplexNumbers1/IMCONJUGATE.php b/samples/ComplexNumbers1/IMCONJUGATE.php index 876c37e9c..04f57f716 100644 --- a/samples/ComplexNumbers1/IMCONJUGATE.php +++ b/samples/ComplexNumbers1/IMCONJUGATE.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Conjugate value of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers1/IMREAL.php b/samples/ComplexNumbers1/IMREAL.php index 0ff28ab47..c2df07fac 100644 --- a/samples/ComplexNumbers1/IMREAL.php +++ b/samples/ComplexNumbers1/IMREAL.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The real component of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMCOS.php b/samples/ComplexNumbers2/IMCOS.php index 6cc1c63ac..bf5c44421 100644 --- a/samples/ComplexNumbers2/IMCOS.php +++ b/samples/ComplexNumbers2/IMCOS.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Cosine of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMCOSH.php b/samples/ComplexNumbers2/IMCOSH.php index c23441a73..3ecf351a1 100644 --- a/samples/ComplexNumbers2/IMCOSH.php +++ b/samples/ComplexNumbers2/IMCOSH.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Hyperbolic Cosine of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMCOT.php b/samples/ComplexNumbers2/IMCOT.php index babce0f83..36e867f80 100644 --- a/samples/ComplexNumbers2/IMCOT.php +++ b/samples/ComplexNumbers2/IMCOT.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Cotangent of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMCSC.php b/samples/ComplexNumbers2/IMCSC.php index eec7531d0..7cc209760 100644 --- a/samples/ComplexNumbers2/IMCSC.php +++ b/samples/ComplexNumbers2/IMCSC.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Cosecant of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMCSCH.php b/samples/ComplexNumbers2/IMCSCH.php index 6971bf18d..1529e6f44 100644 --- a/samples/ComplexNumbers2/IMCSCH.php +++ b/samples/ComplexNumbers2/IMCSCH.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Hyperbolic Cosecant of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMDIV.php b/samples/ComplexNumbers2/IMDIV.php index efc7c40fb..0e719e3dd 100644 --- a/samples/ComplexNumbers2/IMDIV.php +++ b/samples/ComplexNumbers2/IMDIV.php @@ -34,10 +34,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Quotient of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . ' is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMEXP.php b/samples/ComplexNumbers2/IMEXP.php index 83febe29e..1cc81a9f5 100644 --- a/samples/ComplexNumbers2/IMEXP.php +++ b/samples/ComplexNumbers2/IMEXP.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Exponential of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMLN.php b/samples/ComplexNumbers2/IMLN.php index ec997bc0f..e27156ca1 100644 --- a/samples/ComplexNumbers2/IMLN.php +++ b/samples/ComplexNumbers2/IMLN.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Natural Logarithm of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMLOG10.php b/samples/ComplexNumbers2/IMLOG10.php index 7eb5795d5..4a0cdac7e 100644 --- a/samples/ComplexNumbers2/IMLOG10.php +++ b/samples/ComplexNumbers2/IMLOG10.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Base-10 Logarithm of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers2/IMLOG2.php b/samples/ComplexNumbers2/IMLOG2.php index b639481b3..787455e6c 100644 --- a/samples/ComplexNumbers2/IMLOG2.php +++ b/samples/ComplexNumbers2/IMLOG2.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Base-2 Logarithm of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMPOWER.php b/samples/ComplexNumbers3/IMPOWER.php index 43006d5e1..5c86bfb29 100644 --- a/samples/ComplexNumbers3/IMPOWER.php +++ b/samples/ComplexNumbers3/IMPOWER.php @@ -41,10 +41,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' raised to the power of ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . ' is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMPRODUCT.php b/samples/ComplexNumbers3/IMPRODUCT.php index feea9eb84..4fbacff97 100644 --- a/samples/ComplexNumbers3/IMPRODUCT.php +++ b/samples/ComplexNumbers3/IMPRODUCT.php @@ -34,10 +34,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Product of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . ' is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSEC.php b/samples/ComplexNumbers3/IMSEC.php index 163c7dfa1..c5395c7b8 100644 --- a/samples/ComplexNumbers3/IMSEC.php +++ b/samples/ComplexNumbers3/IMSEC.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Secant of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSECH.php b/samples/ComplexNumbers3/IMSECH.php index d726492c4..b11c3b809 100644 --- a/samples/ComplexNumbers3/IMSECH.php +++ b/samples/ComplexNumbers3/IMSECH.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Hyperbolic Ssecant of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSIN.php b/samples/ComplexNumbers3/IMSIN.php index e153ab06a..57853ba42 100644 --- a/samples/ComplexNumbers3/IMSIN.php +++ b/samples/ComplexNumbers3/IMSIN.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Sine of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSINH.php b/samples/ComplexNumbers3/IMSINH.php index 699527a1e..2e82f9cc9 100644 --- a/samples/ComplexNumbers3/IMSINH.php +++ b/samples/ComplexNumbers3/IMSINH.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Hyperbolic Sine of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSQRT.php b/samples/ComplexNumbers3/IMSQRT.php index d2ce3a834..7e1395097 100644 --- a/samples/ComplexNumbers3/IMSQRT.php +++ b/samples/ComplexNumbers3/IMSQRT.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Square Root of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSUB.php b/samples/ComplexNumbers3/IMSUB.php index 439973262..47c00d791 100644 --- a/samples/ComplexNumbers3/IMSUB.php +++ b/samples/ComplexNumbers3/IMSUB.php @@ -34,10 +34,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Difference between " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . ' is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMSUM.php b/samples/ComplexNumbers3/IMSUM.php index 58d32fe98..c9d5b91da 100644 --- a/samples/ComplexNumbers3/IMSUM.php +++ b/samples/ComplexNumbers3/IMSUM.php @@ -34,10 +34,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Sum of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' and ' - . $worksheet->getCell('B' . $row)->getValue() + . $worksheet->getCell('B' . $row)->getValueString() . ' is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() ); } diff --git a/samples/ComplexNumbers3/IMTAN.php b/samples/ComplexNumbers3/IMTAN.php index b995c3f53..49d676732 100644 --- a/samples/ComplexNumbers3/IMTAN.php +++ b/samples/ComplexNumbers3/IMTAN.php @@ -41,8 +41,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { for ($row = 1; $row <= $testDataCount; ++$row) { $helper->log( "(E$row): The Tangent of " - . $worksheet->getCell('A' . $row)->getValue() + . $worksheet->getCell('A' . $row)->getValueString() . ' is ' - . $worksheet->getCell('B' . $row)->getCalculatedValue() + . $worksheet->getCell('B' . $row)->getCalculatedValueString() ); } diff --git a/samples/DateTime/DATE.php b/samples/DateTime/DATE.php index 40d12d3ee..bd1c5ff6d 100644 --- a/samples/DateTime/DATE.php +++ b/samples/DateTime/DATE.php @@ -38,8 +38,8 @@ for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log("(A{$row}) Year: " . $worksheet->getCell('A' . $row)->getFormattedValue()); $helper->log("(B{$row}) Month: " . $worksheet->getCell('B' . $row)->getFormattedValue()); $helper->log("(C{$row}) Day: " . $worksheet->getCell('C' . $row)->getFormattedValue()); - $helper->log('Formula: ' . $worksheet->getCell('D' . $row)->getValue()); - $helper->log('Excel DateStamp: ' . $worksheet->getCell('D' . $row)->getCalculatedValue()); + $helper->log('Formula: ' . $worksheet->getCell('D' . $row)->getValueString()); + $helper->log('Excel DateStamp: ' . $worksheet->getCell('D' . $row)->getCalculatedValueString()); $helper->log('Formatted DateStamp: ' . $worksheet->getCell('E' . $row)->getFormattedValue()); $helper->log(''); } diff --git a/samples/DateTime/DATEDIF.php b/samples/DateTime/DATEDIF.php index bf21a5532..f1cc13966 100644 --- a/samples/DateTime/DATEDIF.php +++ b/samples/DateTime/DATEDIF.php @@ -52,10 +52,10 @@ for ($row = 1; $row <= $testDateCount; ++$row) { $worksheet->getCell('E' . $row)->getFormattedValue(), $worksheet->getCell('F' . $row)->getFormattedValue() )); - $helper->log('In years ("Y"): ' . $worksheet->getCell('G' . $row)->getCalculatedValue()); - $helper->log('In months ("M"): ' . $worksheet->getCell('H' . $row)->getCalculatedValue()); - $helper->log('In days ("D"): ' . $worksheet->getCell('I' . $row)->getCalculatedValue()); - $helper->log('In days ignoring months and years ("MD"): ' . $worksheet->getCell('J' . $row)->getCalculatedValue()); - $helper->log('In months ignoring days and years ("YM"): ' . $worksheet->getCell('K' . $row)->getCalculatedValue()); - $helper->log('In days ignoring years ("YD"): ' . $worksheet->getCell('L' . $row)->getCalculatedValue()); + $helper->log('In years ("Y"): ' . $worksheet->getCell('G' . $row)->getCalculatedValueString()); + $helper->log('In months ("M"): ' . $worksheet->getCell('H' . $row)->getCalculatedValueString()); + $helper->log('In days ("D"): ' . $worksheet->getCell('I' . $row)->getCalculatedValueString()); + $helper->log('In days ignoring months and years ("MD"): ' . $worksheet->getCell('J' . $row)->getCalculatedValueString()); + $helper->log('In months ignoring days and years ("YM"): ' . $worksheet->getCell('K' . $row)->getCalculatedValueString()); + $helper->log('In days ignoring years ("YD"): ' . $worksheet->getCell('L' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime/DATEVALUE.php b/samples/DateTime/DATEVALUE.php index fe3e402af..64346ce01 100644 --- a/samples/DateTime/DATEVALUE.php +++ b/samples/DateTime/DATEVALUE.php @@ -36,8 +36,8 @@ $worksheet->getStyle('C1:C' . $testDateCount) $helper->log('Warning: The PhpSpreadsheet DATEVALUE() function accepts a wider range of date formats than MS Excel DATEFORMAT() function.'); for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log("(A{$row}) Date String: " . $worksheet->getCell('A' . $row)->getFormattedValue()); - $helper->log('Formula: ' . $worksheet->getCell('B' . $row)->getValue()); - $helper->log('Excel DateStamp: ' . $worksheet->getCell('B' . $row)->getCalculatedValue()); + $helper->log('Formula: ' . $worksheet->getCell('B' . $row)->getValueString()); + $helper->log('Excel DateStamp: ' . $worksheet->getCell('B' . $row)->getCalculatedValueString()); $helper->log('Formatted DateStamp: ' . $worksheet->getCell('C' . $row)->getFormattedValue()); $helper->log(''); } diff --git a/samples/DateTime/DAY.php b/samples/DateTime/DAY.php index 4dcf2536f..cb8e1e5f4 100644 --- a/samples/DateTime/DAY.php +++ b/samples/DateTime/DAY.php @@ -46,5 +46,5 @@ $worksheet->getStyle('E1:E' . $testDateCount) // Test the formulae for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('Day is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('Day is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime/DAYS.php b/samples/DateTime/DAYS.php index 0c6022a51..32504ec2d 100644 --- a/samples/DateTime/DAYS.php +++ b/samples/DateTime/DAYS.php @@ -49,5 +49,5 @@ for ($row = 1; $row <= $testDateCount; ++$row) { $worksheet->getCell('E' . $row)->getFormattedValue(), $worksheet->getCell('F' . $row)->getFormattedValue() )); - $helper->log('Days: ' . $worksheet->getCell('G' . $row)->getCalculatedValue()); + $helper->log('Days: ' . $worksheet->getCell('G' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime/DAYS360.php b/samples/DateTime/DAYS360.php index 4319c08e9..1d245b1cc 100644 --- a/samples/DateTime/DAYS360.php +++ b/samples/DateTime/DAYS360.php @@ -51,9 +51,9 @@ for ($row = 1; $row <= $testDateCount; ++$row) { )); $helper->log( 'Days: ' - . $worksheet->getCell('G' . $row)->getCalculatedValue() + . $worksheet->getCell('G' . $row)->getCalculatedValueString() . ' (US) ' - . $worksheet->getCell('H' . $row)->getCalculatedValue() + . $worksheet->getCell('H' . $row)->getCalculatedValueString() . ' (European)' ); } diff --git a/samples/DateTime/EDATE.php b/samples/DateTime/EDATE.php index 88150ec96..b9453e741 100644 --- a/samples/DateTime/EDATE.php +++ b/samples/DateTime/EDATE.php @@ -40,7 +40,7 @@ for ($row = 1; $row <= $testDateCount; ++$row) { . ' and ' . $worksheet->getCell('C' . $row)->getFormattedValue() . ' months is ' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ' (' . $worksheet->getCell('D' . $row)->getFormattedValue() . ')' diff --git a/samples/DateTime/EOMONTH.php b/samples/DateTime/EOMONTH.php index 34307763e..7c5833c3a 100644 --- a/samples/DateTime/EOMONTH.php +++ b/samples/DateTime/EOMONTH.php @@ -38,7 +38,7 @@ for ($row = 1; $row <= $testDateCount; ++$row) { . ' and ' . $worksheet->getCell('C' . $row)->getFormattedValue() . ' months is ' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ' (' . $worksheet->getCell('D' . $row)->getFormattedValue() . ')' diff --git a/samples/DateTime/HOUR.php b/samples/DateTime/HOUR.php index d0b5d4356..6dc57a107 100644 --- a/samples/DateTime/HOUR.php +++ b/samples/DateTime/HOUR.php @@ -44,5 +44,5 @@ $worksheet->getStyle('E1:E' . $testTimeCount) // Test the formulae for ($row = 1; $row <= $testTimeCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('Hour is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('Hour is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime/ISOWEEKNUM.php b/samples/DateTime/ISOWEEKNUM.php index 5a699e95f..9b3f5b683 100644 --- a/samples/DateTime/ISOWEEKNUM.php +++ b/samples/DateTime/ISOWEEKNUM.php @@ -46,5 +46,5 @@ $worksheet->getStyle('E1:E' . $testDateCount) // Test the formulae for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('ISO Week number is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('ISO Week number is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime/MINUTE.php b/samples/DateTime/MINUTE.php index abedecb0a..74d38cca4 100644 --- a/samples/DateTime/MINUTE.php +++ b/samples/DateTime/MINUTE.php @@ -44,5 +44,5 @@ $worksheet->getStyle('E1:E' . $testTimeCount) // Test the formulae for ($row = 1; $row <= $testTimeCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('Minute is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('Minute is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime/MONTH.php b/samples/DateTime/MONTH.php index 30c2f33c2..82d17eee8 100644 --- a/samples/DateTime/MONTH.php +++ b/samples/DateTime/MONTH.php @@ -46,5 +46,5 @@ $worksheet->getStyle('E1:E' . $testDateCount) // Test the formulae for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('Month is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('Month is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime2/NETWORKDAYS.php b/samples/DateTime2/NETWORKDAYS.php index 2676a3b31..f15dc8d92 100644 --- a/samples/DateTime2/NETWORKDAYS.php +++ b/samples/DateTime2/NETWORKDAYS.php @@ -62,9 +62,9 @@ for ($row = 1; $row <= 12; ++$row) { . ' and ' . $worksheet->getCell('B' . $row)->getFormattedValue() . ' is ' - . $worksheet->getCell('C' . $row)->getCalculatedValue() + . $worksheet->getCell('C' . $row)->getCalculatedValueString() . ' working days; ' - . $worksheet->getCell('D' . $row)->getCalculatedValue() + . $worksheet->getCell('D' . $row)->getCalculatedValueString() . ' excluding public holidays' ); } diff --git a/samples/DateTime2/NOW.php b/samples/DateTime2/NOW.php index 06664971b..ca819168d 100644 --- a/samples/DateTime2/NOW.php +++ b/samples/DateTime2/NOW.php @@ -22,7 +22,7 @@ $worksheet->getStyle('A1') // Test the formulae $helper->log( 'Today is ' - . $worksheet->getCell('A1')->getCalculatedValue() + . $worksheet->getCell('A1')->getCalculatedValueString() . ' (' . $worksheet->getCell('A1')->getFormattedValue() . ')' diff --git a/samples/DateTime2/SECOND.php b/samples/DateTime2/SECOND.php index 07d5ba7da..3d7c147f3 100644 --- a/samples/DateTime2/SECOND.php +++ b/samples/DateTime2/SECOND.php @@ -44,5 +44,5 @@ $worksheet->getStyle('E1:E' . $testTimeCount) // Test the formulae for ($row = 1; $row <= $testTimeCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('Second is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('Second is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime2/TIME.php b/samples/DateTime2/TIME.php index 5b60e3211..cd2e08630 100644 --- a/samples/DateTime2/TIME.php +++ b/samples/DateTime2/TIME.php @@ -36,8 +36,8 @@ for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log("(A{$row}) Hour: " . $worksheet->getCell('A' . $row)->getFormattedValue()); $helper->log("(B{$row}) Minute: " . $worksheet->getCell('B' . $row)->getFormattedValue()); $helper->log("(C{$row}) Second: " . $worksheet->getCell('C' . $row)->getFormattedValue()); - $helper->log('Formula: ' . $worksheet->getCell('D' . $row)->getValue()); - $helper->log('Excel TimeStamp: ' . $worksheet->getCell('D' . $row)->getCalculatedValue()); + $helper->log('Formula: ' . $worksheet->getCell('D' . $row)->getValueString()); + $helper->log('Excel TimeStamp: ' . $worksheet->getCell('D' . $row)->getCalculatedValueString()); $helper->log('Formatted TimeStamp: ' . $worksheet->getCell('E' . $row)->getFormattedValue()); $helper->log(''); } diff --git a/samples/DateTime2/TIMEVALUE.php b/samples/DateTime2/TIMEVALUE.php index 18aad1d02..cf8c71a58 100644 --- a/samples/DateTime2/TIMEVALUE.php +++ b/samples/DateTime2/TIMEVALUE.php @@ -32,7 +32,7 @@ $worksheet->getStyle('C1:C' . $testDateCount) // Test the formulae for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log("(A{$row}) Time String: " . $worksheet->getCell('A' . $row)->getFormattedValue()); - $helper->log('Formula: ' . $worksheet->getCell('B' . $row)->getValue()); + $helper->log('Formula: ' . $worksheet->getCell('B' . $row)->getValueString()); $helper->log('Excel TimeStamp: ' . $worksheet->getCell('B' . $row)->getFormattedValue()); $helper->log('Formatted TimeStamp: ' . $worksheet->getCell('C' . $row)->getFormattedValue()); $helper->log(''); diff --git a/samples/DateTime2/TODAY.php b/samples/DateTime2/TODAY.php index 79b6bf6f4..4c11f4dcf 100644 --- a/samples/DateTime2/TODAY.php +++ b/samples/DateTime2/TODAY.php @@ -22,7 +22,7 @@ $worksheet->getStyle('A1') // Test the formulae $helper->log( 'Today is ' - . $worksheet->getCell('A1')->getCalculatedValue() + . $worksheet->getCell('A1')->getCalculatedValueString() . ' (' . $worksheet->getCell('A1')->getFormattedValue() . ')' diff --git a/samples/DateTime2/WEEKDAY.php b/samples/DateTime2/WEEKDAY.php index cea7561e8..c6ba0beae 100644 --- a/samples/DateTime2/WEEKDAY.php +++ b/samples/DateTime2/WEEKDAY.php @@ -49,12 +49,12 @@ for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); $helper->log( 'Weekday is: ' - . $worksheet->getCell('F' . $row)->getCalculatedValue() + . $worksheet->getCell('F' . $row)->getCalculatedValueString() . ' (1-7 = Sun-Sat)' ); $helper->log( 'Weekday is: ' - . $worksheet->getCell('G' . $row)->getCalculatedValue() + . $worksheet->getCell('G' . $row)->getCalculatedValueString() . ' (1-7 = Mon-Sun)' ); } diff --git a/samples/DateTime2/WEEKNUM.php b/samples/DateTime2/WEEKNUM.php index c4e58f7f0..9b2850aa4 100644 --- a/samples/DateTime2/WEEKNUM.php +++ b/samples/DateTime2/WEEKNUM.php @@ -47,6 +47,6 @@ $worksheet->getStyle('E1:E' . $testDateCount) // Test the formulae for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('System 1 Week number is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); - $helper->log('System 2 (ISO-8601) Week number is: ' . $worksheet->getCell('G' . $row)->getCalculatedValue()); + $helper->log('System 1 Week number is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); + $helper->log('System 2 (ISO-8601) Week number is: ' . $worksheet->getCell('G' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime2/YEAR.php b/samples/DateTime2/YEAR.php index 6bf5e24b0..ecfd25b18 100644 --- a/samples/DateTime2/YEAR.php +++ b/samples/DateTime2/YEAR.php @@ -46,5 +46,5 @@ $worksheet->getStyle('E1:E' . $testDateCount) // Test the formulae for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); - $helper->log('Year is: ' . $worksheet->getCell('F' . $row)->getCalculatedValue()); + $helper->log('Year is: ' . $worksheet->getCell('F' . $row)->getCalculatedValueString()); } diff --git a/samples/DateTime2/YEARFRAC.php b/samples/DateTime2/YEARFRAC.php index ea8343192..4c7b44265 100644 --- a/samples/DateTime2/YEARFRAC.php +++ b/samples/DateTime2/YEARFRAC.php @@ -55,27 +55,27 @@ for ($row = 1; $row <= $testDateCount; ++$row) { )); $helper->log( 'Days: ' - . $worksheet->getCell('G' . $row)->getCalculatedValue() + . $worksheet->getCell('G' . $row)->getCalculatedValueString() . ' - US (NASD) 30/360' ); $helper->log( 'Days: ' - . $worksheet->getCell('H' . $row)->getCalculatedValue() + . $worksheet->getCell('H' . $row)->getCalculatedValueString() . ' - Actual' ); $helper->log( 'Days: ' - . $worksheet->getCell('I' . $row)->getCalculatedValue() + . $worksheet->getCell('I' . $row)->getCalculatedValueString() . ' - Actual/360' ); $helper->log( 'Days: ' - . $worksheet->getCell('J' . $row)->getCalculatedValue() + . $worksheet->getCell('J' . $row)->getCalculatedValueString() . ' - Actual/365' ); $helper->log( 'Days: ' - . $worksheet->getCell('K' . $row)->getCalculatedValue() + . $worksheet->getCell('K' . $row)->getCalculatedValueString() . ' - European 30/360' ); } diff --git a/samples/download.php b/samples/download.php index 6b4380dba..cd324bba8 100644 --- a/samples/download.php +++ b/samples/download.php @@ -4,9 +4,10 @@ require_once __DIR__ . '/Bootstrap.php'; use PhpOffice\PhpSpreadsheet\Helper\Downloader; use PhpOffice\PhpSpreadsheet\Helper\Sample; +use PhpOffice\PhpSpreadsheet\Shared\StringHelper; -$filename = basename($_GET['name']); -$filetype = $_GET['type']; +$filename = basename(StringHelper::convertToString($_GET['name'] ?? '')); +$filetype = StringHelper::convertToString($_GET['type'] ?? ''); try { $downloader = new Downloader((new Sample())->getTemporaryFolder(), $filename, $filetype); diff --git a/src/PhpSpreadsheet/Cell/Cell.php b/src/PhpSpreadsheet/Cell/Cell.php index 03119915d..704352456 100644 --- a/src/PhpSpreadsheet/Cell/Cell.php +++ b/src/PhpSpreadsheet/Cell/Cell.php @@ -181,9 +181,7 @@ class Cell implements Stringable public function getValueString(): string { - $value = $this->value; - - return ($value === '' || is_scalar($value) || $value instanceof Stringable) ? "$value" : ''; + return StringHelper::convertToString($this->value, false); } /** @@ -204,9 +202,9 @@ class Cell implements Stringable protected static function updateIfCellIsTableHeader(?Worksheet $workSheet, self $cell, mixed $oldValue, mixed $newValue): void { - $oldValue = (is_scalar($oldValue) || $oldValue instanceof Stringable) ? ((string) $oldValue) : null; - $newValue = (is_scalar($newValue) || $newValue instanceof Stringable) ? ((string) $newValue) : null; - if (StringHelper::strToLower($oldValue ?? '') === StringHelper::strToLower($newValue ?? '') || $workSheet === null) { + $oldValue = StringHelper::convertToString($oldValue, false); + $newValue = StringHelper::convertToString($newValue, false); + if (StringHelper::strToLower($oldValue) === StringHelper::strToLower($newValue) || $workSheet === null) { return; } @@ -279,24 +277,19 @@ class Cell implements Stringable // no break case DataType::TYPE_INLINE: // Rich text - if ($value !== null && !is_scalar($value) && !($value instanceof Stringable)) { - throw new SpreadsheetException('Invalid unstringable value for datatype Inline/String/String2'); - } - $this->value = DataType::checkString(($value instanceof RichText) ? $value : ((string) $value)); + $value2 = StringHelper::convertToString($value, true); + $this->value = DataType::checkString(($value instanceof RichText) ? $value : $value2); break; case DataType::TYPE_NUMERIC: - if (is_string($value) && !is_numeric($value)) { + if ($value !== null && !is_bool($value) && !is_numeric($value)) { throw new SpreadsheetException('Invalid numeric value for datatype Numeric'); } $this->value = 0 + $value; break; case DataType::TYPE_FORMULA: - if ($value !== null && !is_scalar($value) && !($value instanceof Stringable)) { - throw new SpreadsheetException('Invalid unstringable value for datatype Formula'); - } - $this->value = (string) $value; + $this->value = StringHelper::convertToString($value, true); break; case DataType::TYPE_BOOL: @@ -391,7 +384,7 @@ class Cell implements Stringable $value = array_shift($value); } - return ($value === '' || is_scalar($value) || $value instanceof Stringable) ? "$value" : ''; + return StringHelper::convertToString($value, false); } /** @@ -970,7 +963,7 @@ class Cell implements Stringable { $retVal = $this->value; - return ($retVal === null || is_scalar($retVal) || $retVal instanceof Stringable) ? ((string) $retVal) : ''; + return StringHelper::convertToString($retVal, false); } public function getIgnoredErrors(): IgnoredErrors diff --git a/src/PhpSpreadsheet/Cell/DataType.php b/src/PhpSpreadsheet/Cell/DataType.php index a213725c0..39969d37a 100644 --- a/src/PhpSpreadsheet/Cell/DataType.php +++ b/src/PhpSpreadsheet/Cell/DataType.php @@ -4,7 +4,6 @@ namespace PhpOffice\PhpSpreadsheet\Cell; use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Shared\StringHelper; -use Stringable; class DataType { @@ -79,10 +78,11 @@ class DataType */ public static function checkErrorCode(mixed $value): string { - $value = (is_scalar($value) || $value instanceof Stringable) ? ((string) $value) : '#NULL!'; + $default = '#NULL!'; + $value = ($value === null) ? $default : StringHelper::convertToString($value, false, $default); if (!isset(self::$errorCodes[$value])) { - $value = '#NULL!'; + $value = $default; } return $value; diff --git a/src/PhpSpreadsheet/Helper/Downloader.php b/src/PhpSpreadsheet/Helper/Downloader.php index 85131dc1d..0c39efe04 100644 --- a/src/PhpSpreadsheet/Helper/Downloader.php +++ b/src/PhpSpreadsheet/Helper/Downloader.php @@ -35,8 +35,9 @@ class Downloader $filepath = "{$folder}/{$filename}"; $this->filepath = (string) realpath($filepath); $this->filename = basename($filepath); - if ((file_exists($this->filepath) === false) || (is_readable($this->filepath) === false)) { - throw new Exception('File not found, or cannot be read'); + clearstatcache(); + if ((is_file($this->filepath) === false) || (is_readable($this->filepath) === false)) { + throw new Exception('File not found, or not a regular file, or cannot be read'); } $filetype ??= pathinfo($filename, PATHINFO_EXTENSION); diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index af10d8b9a..d40cd0669 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -40,7 +40,6 @@ use PhpOffice\PhpSpreadsheet\Style\Style; use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use SimpleXMLElement; -use Stringable; use Throwable; use XMLReader; use ZipArchive; @@ -1179,6 +1178,7 @@ class Xlsx extends BaseReader $textboxDirection = Comment::TEXTBOX_DIRECTION_LTR; } if (is_array($clientData) && !empty($clientData)) { + /** @var SimpleXMLElement */ $clientData = $clientData[0]; if (isset($clientData['ObjectType']) && (string) $clientData['ObjectType'] == 'Note') { @@ -1208,6 +1208,7 @@ class Xlsx extends BaseReader $fillImageRelNode = $shape->xpath('.//v:fill/@o:relid'); if (is_array($fillImageRelNode) && !empty($fillImageRelNode)) { + /** @var SimpleXMLElement */ $fillImageRelNode = $fillImageRelNode[0]; if (isset($fillImageRelNode['relid'])) { @@ -1217,6 +1218,7 @@ class Xlsx extends BaseReader $fillImageTitleNode = $shape->xpath('.//v:fill/@o:title'); if (is_array($fillImageTitleNode) && !empty($fillImageTitleNode)) { + /** @var SimpleXMLElement */ $fillImageTitleNode = $fillImageTitleNode[0]; if (isset($fillImageTitleNode['title'])) { @@ -1226,7 +1228,7 @@ class Xlsx extends BaseReader if (($column !== null) && ($row !== null)) { // Set comment properties - $comment = $docSheet->getComment([$column + 1, $row + 1]); + $comment = $docSheet->getComment([(int) $column + 1, (int) $row + 1]); $comment->getFillColor()->setRGB($fillColor); if (isset($drowingImages[$fillImageRelId])) { $objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); @@ -1490,7 +1492,7 @@ class Xlsx extends BaseReader $shadow->setAlignment(self::getArrayItemString(self::getAttributes($outerShdw), 'algn')); $clr = $outerShdw->srgbClr ?? $outerShdw->prstClr; $shadow->getColor()->setRGB(self::getArrayItemString(self::getAttributes($clr), 'val')); - $shadow->setAlpha(self::getArrayItem(self::getAttributes($clr->alpha), 'val') / 1000); + $shadow->setAlpha(self::getArrayItem(self::getAttributes($clr->alpha), 'val') / 1000); // @phpstan-ignore-line } $this->readHyperLinkDrawing($objDrawing, $oneCellAnchor, $hyperlinks); @@ -1595,7 +1597,7 @@ class Xlsx extends BaseReader $shadow->setAlignment(self::getArrayItemString(self::getAttributes($outerShdw), 'algn')); $clr = $outerShdw->srgbClr ?? $outerShdw->prstClr; $shadow->getColor()->setRGB(self::getArrayItemString(self::getAttributes($clr), 'val')); - $shadow->setAlpha(self::getArrayItem(self::getAttributes($clr->alpha), 'val') / 1000); + $shadow->setAlpha(self::getArrayItem(self::getAttributes($clr->alpha), 'val') / 1000); // @phpstan-ignore-line } $this->readHyperLinkDrawing($objDrawing, $twoCellAnchor, $hyperlinks); @@ -2036,7 +2038,7 @@ class Xlsx extends BaseReader { $retVal = self::getArrayItem($array, $key); - return ($retVal === null || is_scalar($retVal) || $retVal instanceof Stringable) ? ((string) $retVal) : ''; + return StringHelper::convertToString($retVal, false); } private static function getArrayItemIntOrSxml(null|array|bool|SimpleXMLElement $array, int|string $key = 0): int|SimpleXMLElement diff --git a/src/PhpSpreadsheet/Reader/Xlsx/Styles.php b/src/PhpSpreadsheet/Reader/Xlsx/Styles.php index 4b1a7d36c..676ea8176 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/Styles.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/Styles.php @@ -459,6 +459,6 @@ class Styles extends BaseParserClass */ private static function getArrayItem(mixed $array): ?SimpleXMLElement { - return is_array($array) ? ($array[0] ?? null) : null; + return is_array($array) ? ($array[0] ?? null) : null; // @phpstan-ignore-line } } diff --git a/src/PhpSpreadsheet/Shared/StringHelper.php b/src/PhpSpreadsheet/Shared/StringHelper.php index d84e9fe11..829c9cf9e 100644 --- a/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/src/PhpSpreadsheet/Shared/StringHelper.php @@ -2,6 +2,9 @@ namespace PhpOffice\PhpSpreadsheet\Shared; +use PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException; +use Stringable; + class StringHelper { /** @@ -643,4 +646,17 @@ class StringHelper { return strlen("$string"); } + + public static function convertToString(mixed $value, bool $throw = true, string $default = ''): string + { + if ($value === null || is_scalar($value) || $value instanceof Stringable) { + return (string) $value; + } + + if ($throw) { + throw new SpreadsheetException('Unable to convert to string'); + } + + return $default; + } } diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php index 806a5fd90..a7b1baf85 100644 --- a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php @@ -109,7 +109,7 @@ class CalculationTest extends TestCase $cell4->setValueExplicit((object) null, DataType::TYPE_FORMULA); self::fail('setValueExplicit formula with unstringable object should have thrown exception'); } catch (SpreadsheetException $e) { - self::assertStringContainsString('Invalid unstringable value for datatype Formula', $e->getMessage()); + self::assertStringContainsString('Unable to convert to string', $e->getMessage()); } $cell5 = $workSheet->getCell('A5'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AllSetupTeardown.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AllSetupTeardown.php index e8f444a39..f7bf917b8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AllSetupTeardown.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AllSetupTeardown.php @@ -128,6 +128,9 @@ class AllSetupTeardown extends TestCase $arrayComma = ''; foreach ($arg as $arrayItem) { $arrayArg .= $arrayComma; + if ($arrayItem !== null && !is_scalar($arrayItem) && !($arrayItem instanceof Stringable)) { + self::fail('non-stringable item'); + } $arrayArg .= $this->convertToString($arrayItem); $arrayComma = ';'; } @@ -162,6 +165,9 @@ class AllSetupTeardown extends TestCase foreach ($arg as $arrayItem) { $formula .= $comma; $comma = ','; + if ($arrayItem !== null && !is_scalar($arrayItem) && !($arrayItem instanceof Stringable)) { + self::fail('non-stringable item'); + } $formula .= $this->convertToString($arrayItem); } } else { diff --git a/tests/PhpSpreadsheetTests/Cell/CellFormulaTest.php b/tests/PhpSpreadsheetTests/Cell/CellFormulaTest.php index 1e588f4da..2459d9832 100644 --- a/tests/PhpSpreadsheetTests/Cell/CellFormulaTest.php +++ b/tests/PhpSpreadsheetTests/Cell/CellFormulaTest.php @@ -49,7 +49,7 @@ class CellFormulaTest extends TestCase $cell->setValueExplicit($formula, DataType::TYPE_FORMULA); self::fail('setValueExplicit should have thrown exception'); } catch (SpreadsheetException $e) { - self::assertStringContainsString('Invalid unstringable value for datatype Formula', $e->getMessage()); + self::assertStringContainsString('Unable to convert to string', $e->getMessage()); } $spreadsheet->disconnectWorksheets(); diff --git a/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php b/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php index 8cddd5fed..d7f2f38e0 100644 --- a/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php +++ b/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Shared; +use DateTime; +use PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException; use PhpOffice\PhpSpreadsheet\Shared\StringHelper; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Csv; @@ -120,4 +122,13 @@ class StringHelperTest extends TestCase $spreadsheet->disconnectWorksheets(); self::assertSame('"1.4";"1004.5";"1000000.5"' . PHP_EOL, $output); } + + public function testNonStringable(): void + { + $dt = new DateTime(); + self::assertSame('', StringHelper::convertToString($dt, false)); + $this->expectException(SpreadsheetException::class); + $this->expectExceptionMessage('Unable to convert to string'); + StringHelper::convertToString($dt); + } } diff --git a/tests/PhpSpreadsheetTests/SpreadsheetSerializeTest.php b/tests/PhpSpreadsheetTests/SpreadsheetSerializeTest.php index 74c691635..92ecedd99 100644 --- a/tests/PhpSpreadsheetTests/SpreadsheetSerializeTest.php +++ b/tests/PhpSpreadsheetTests/SpreadsheetSerializeTest.php @@ -88,8 +88,9 @@ class SpreadsheetSerializeTest extends TestCase $inputFileName = self::getTempFileName(); $ser = (string) file_get_contents($inputFileName); unlink($inputFileName); - $this->spreadsheet = unserialize($ser); - self::assertInstanceOf(Spreadsheet::class, $this->spreadsheet); + $spreadsheet = unserialize($ser); + self::assertInstanceOf(Spreadsheet::class, $spreadsheet); + $this->spreadsheet = $spreadsheet; $sheet = $this->spreadsheet->getActiveSheet(); self::assertSame('=SUM(summedcells)', $sheet->getCell('C1')->getValue()); self::assertSame(15, $sheet->getCell('C1')->getCalculatedValue()); diff --git a/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php b/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php index a90e8ab73..1bc54c3f6 100644 --- a/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php @@ -9,6 +9,7 @@ use DOMXPath; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Cell\DataType; use PhpOffice\PhpSpreadsheet\Shared\Date; +use PhpOffice\PhpSpreadsheet\Shared\StringHelper; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Style\Border; use PhpOffice\PhpSpreadsheet\Style\Color; @@ -151,7 +152,7 @@ class ContentTest extends TestCase $styles[$cell] = '2.5pt solid #22DD00'; $query = 'string(//office:document-content/office:body/office:spreadsheet/table:table/table:table-row[position()=' . ($keyRow + 1) . ']/table:table-cell[position()=' . ($keyCell + 1) . ']/@table:style-name)'; - $idStyle = $xmlPath->evaluate($query); + $idStyle = StringHelper::convertToString($xmlPath->evaluate($query)); foreach ($styles as $direction => $value) { $query = 'string(//office:document-content/office:automatic-styles/style:style[@style:name="' . $idStyle . '"]/style:table-cell-properties/@fo:border-' . $direction . ')'; diff --git a/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php b/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php index a0296804b..d6bc73e12 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php @@ -117,6 +117,11 @@ class WorkbookTest extends TestCase // Add last existing color and add one new color $keyPalette = array_keys($palette); $last = end($keyPalette); + self::assertIsArray($palette[8]); + self::assertIsArray($palette[10]); + self::assertIsArray($palette[12]); + self::assertIsArray($palette[25]); + self::assertIsArray($palette[$last]); $lastColor = $this->paletteToColor($palette[$last]); $paletteTestNine = $palette;