mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 12:07:56 +00:00
Fix PHPStan errors
This commit is contained in:
+1
-16
@@ -7,22 +7,7 @@ parameters:
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getTokenType\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\FormulaToken\\|null\\.$#"
|
||||
count: 9
|
||||
path: src/PhpSpreadsheet/Calculation/FormulaParser.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method setTokenSubType\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\FormulaToken\\|null\\.$#"
|
||||
count: 5
|
||||
path: src/PhpSpreadsheet/Calculation/FormulaParser.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method setValue\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\FormulaToken\\|null\\.$#"
|
||||
count: 5
|
||||
path: src/PhpSpreadsheet/Calculation/FormulaParser.php
|
||||
|
||||
-
|
||||
message: "#^Strict comparison using \\=\\=\\= between PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\FormulaToken and null will always evaluate to false\\.$#"
|
||||
count: 1
|
||||
count: 8
|
||||
path: src/PhpSpreadsheet/Calculation/FormulaParser.php
|
||||
|
||||
-
|
||||
|
||||
@@ -299,6 +299,7 @@ class FormulaParser
|
||||
$value = '';
|
||||
}
|
||||
|
||||
/** @var FormulaToken $tmp */
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
@@ -322,11 +323,13 @@ class FormulaParser
|
||||
$value = '';
|
||||
}
|
||||
|
||||
/** @var FormulaToken $tmp */
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
$tokens1[] = $tmp;
|
||||
|
||||
/** @var FormulaToken $tmp */
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
@@ -414,6 +417,7 @@ class FormulaParser
|
||||
$value = '';
|
||||
}
|
||||
|
||||
/** @var FormulaToken $tmp */
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
@@ -436,6 +440,7 @@ class FormulaParser
|
||||
$value = '';
|
||||
}
|
||||
|
||||
/** @var FormulaToken $tmp */
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
@@ -471,10 +476,6 @@ class FormulaParser
|
||||
$nextToken = null;
|
||||
}
|
||||
|
||||
if ($token === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($token->getTokenType() != FormulaToken::TOKEN_TYPE_WHITESPACE) {
|
||||
$tokens2[] = $token;
|
||||
|
||||
@@ -524,15 +525,6 @@ class FormulaParser
|
||||
} else {
|
||||
$previousToken = null;
|
||||
}
|
||||
//if (isset($tokens2[$i + 1])) {
|
||||
// $nextToken = $tokens2[$i + 1];
|
||||
//} else {
|
||||
// $nextToken = null;
|
||||
//}
|
||||
|
||||
if ($token === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '-') {
|
||||
if ($i == 0) {
|
||||
|
||||
Reference in New Issue
Block a user