Skip to content

Commit cf2c0e5

Browse files
committed
Fix variadic docblocks
1 parent 4a47a32 commit cf2c0e5

File tree

5 files changed

+80
-42
lines changed

5 files changed

+80
-42
lines changed

src/PhpSpreadsheet/Calculation.php

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
1414
use PhpOffice\PhpSpreadsheet\Calculation\Statistical;
1515
use PhpOffice\PhpSpreadsheet\Calculation\TextData;
16+
use PhpOffice\PhpSpreadsheet\Calculation\Token\Stack;
1617

1718
/**
1819
* Copyright (c) 2006 - 2016 PhpSpreadsheet.
@@ -2059,8 +2060,6 @@ public static function getInstance(Spreadsheet $spreadsheet = null)
20592060

20602061
/**
20612062
* Unset an instance of this class.
2062-
*
2063-
* @param Spreadsheet $spreadsheet Injected spreadsheet identifying the instance to unset
20642063
*/
20652064
public function __destruct()
20662065
{
@@ -2314,6 +2313,14 @@ public function setLocale($locale)
23142313
return false;
23152314
}
23162315

2316+
/**
2317+
* @param string $fromSeparator
2318+
* @param string $toSeparator
2319+
* @param string $formula
2320+
* @param bool $inBraces
2321+
*
2322+
* @return string
2323+
*/
23172324
public static function translateSeparator($fromSeparator, $toSeparator, $formula, &$inBraces)
23182325
{
23192326
$strlen = mb_strlen($formula);
@@ -2657,6 +2664,12 @@ public function calculateFormula($formula, $cellID = null, Cell $pCell = null)
26572664
return $result;
26582665
}
26592666

2667+
/**
2668+
* @param string $cellReference
2669+
* @param mixed $cellValue
2670+
*
2671+
* @return bool
2672+
*/
26602673
public function getValueFromCache($cellReference, &$cellValue)
26612674
{
26622675
// Is calculation cacheing enabled?
@@ -2985,6 +2998,11 @@ private function showTypeDetails($value)
29852998
}
29862999
}
29873000

3001+
/**
3002+
* @param string $formula
3003+
*
3004+
* @return string
3005+
*/
29883006
private function convertMatrixReferences($formula)
29893007
{
29903008
static $matrixReplaceFrom = ['{', ';', '}'];
@@ -3073,6 +3091,13 @@ private static function mkMatrix(...$args)
30733091
];
30743092

30753093
// Convert infix to postfix notation
3094+
3095+
/**
3096+
* @param string $formula
3097+
* @param Cell|null $pCell
3098+
*
3099+
* @return bool
3100+
*/
30763101
private function _parseFormula($formula, Cell $pCell = null)
30773102
{
30783103
if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
@@ -3094,7 +3119,7 @@ private function _parseFormula($formula, Cell $pCell = null)
30943119

30953120
// Start with initialisation
30963121
$index = 0;
3097-
$stack = new Calculation\Token\Stack();
3122+
$stack = new Stack();
30983123
$output = [];
30993124
$expectingOperator = false; // We use this test in syntax-checking the expression to determine when a
31003125
// - is a negation or + is a positive operator rather than an operation
@@ -3401,8 +3426,11 @@ private static function dataTestReference(&$operandData)
34013426
// evaluate postfix notation
34023427

34033428
/**
3404-
* @param string $cellID
34053429
* @param mixed $tokens
3430+
* @param string|null $cellID
3431+
* @param Cell|null $pCell
3432+
*
3433+
* @return bool
34063434
*/
34073435
private function processTokenStack($tokens, $cellID = null, Cell $pCell = null)
34083436
{
@@ -3414,7 +3442,7 @@ private function processTokenStack($tokens, $cellID = null, Cell $pCell = null)
34143442
// so we store the parent cell collection so that we can re-attach it when necessary
34153443
$pCellWorksheet = ($pCell !== null) ? $pCell->getWorksheet() : null;
34163444
$pCellParent = ($pCell !== null) ? $pCell->getParent() : null;
3417-
$stack = new Calculation\Token\Stack();
3445+
$stack = new Stack();
34183446

34193447
// Loop through each token in turn
34203448
foreach ($tokens as $tokenData) {
@@ -3811,7 +3839,17 @@ private function validateBinaryOperand($cellID, &$operand, &$stack)
38113839
return true;
38123840
}
38133841

3814-
private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, &$stack, $recursingArrays = false)
3842+
/**
3843+
* @param string|null $cellID
3844+
* @param mixed $operand1
3845+
* @param mixed $operand2
3846+
* @param string $operation
3847+
* @param Stack $stack
3848+
* @param bool $recursingArrays
3849+
*
3850+
* @return bool
3851+
*/
3852+
private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, Stack &$stack, $recursingArrays = false)
38153853
{
38163854
// If we're dealing with matrix operations, we want a matrix result
38173855
if ((is_array($operand1)) || (is_array($operand2))) {
@@ -3951,7 +3989,7 @@ private function strcmpLowercaseFirst($str1, $str2)
39513989

39523990
/**
39533991
* @param string $matrixFunction
3954-
* @param mixed $cellID
3992+
* @param string|null $cellID
39553993
* @param mixed $operand1
39563994
* @param mixed $operand2
39573995
* @param mixed $operation

src/PhpSpreadsheet/Calculation/Engineering.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ public static function IMSUB($complexNumber1, $complexNumber2)
22932293
* Excel Function:
22942294
* IMSUM(complexNumber[,complexNumber[,...]])
22952295
*
2296-
* @param string $complexNumbers Series of complex numbers to add
2296+
* @param string ...$complexNumbers Series of complex numbers to add
22972297
*
22982298
* @return string
22992299
*/
@@ -2333,7 +2333,7 @@ public static function IMSUM(...$complexNumbers)
23332333
* Excel Function:
23342334
* IMPRODUCT(complexNumber[,complexNumber[,...]])
23352335
*
2336-
* @param string $complexNumbers Series of complex numbers to multiply
2336+
* @param string ...$complexNumbers Series of complex numbers to multiply
23372337
*
23382338
* @return string
23392339
*/

src/PhpSpreadsheet/Calculation/Logical.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function false()
8080
*
8181
* @category Logical Functions
8282
*
83-
* @param mixed $args Data values
83+
* @param mixed ...$args Data values
8484
*
8585
* @return string|bool the logical AND of the arguments
8686
*/

src/PhpSpreadsheet/Calculation/MathTrig.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public static function FLOOR($number, $significance = null)
347347
*
348348
* @category Mathematical and Trigonometric Functions
349349
*
350-
* @param mixed $args Data values
350+
* @param mixed ...$args Data values
351351
*
352352
* @return int Greatest Common Divisor
353353
*/
@@ -456,7 +456,7 @@ public static function INT($number)
456456
*
457457
* @category Mathematical and Trigonometric Functions
458458
*
459-
* @param mixed $args Data values
459+
* @param mixed ...$args Data values
460460
*
461461
* @return int Lowest Common Multiplier
462462
*/
@@ -859,7 +859,7 @@ public static function POWER($x = 0, $y = 2)
859859
*
860860
* @category Mathematical and Trigonometric Functions
861861
*
862-
* @param mixed $args Data values
862+
* @param mixed ...$args Data values
863863
*
864864
* @return float
865865
*/
@@ -899,7 +899,7 @@ public static function PRODUCT(...$args)
899899
*
900900
* @category Mathematical and Trigonometric Functions
901901
*
902-
* @param mixed $args Data values
902+
* @param mixed ...$args Data values
903903
*
904904
* @return float
905905
*/
@@ -1185,7 +1185,7 @@ public static function SUBTOTAL(...$args)
11851185
*
11861186
* @category Mathematical and Trigonometric Functions
11871187
*
1188-
* @param mixed $args Data values
1188+
* @param mixed ...$args Data values
11891189
*
11901190
* @return float
11911191
*/
@@ -1306,7 +1306,7 @@ public static function SUMIFS(...$args)
13061306
*
13071307
* @category Mathematical and Trigonometric Functions
13081308
*
1309-
* @param mixed $args Data values
1309+
* @param mixed ...$args Data values
13101310
*
13111311
* @return float
13121312
*/
@@ -1351,7 +1351,7 @@ public static function SUMPRODUCT(...$args)
13511351
*
13521352
* @category Mathematical and Trigonometric Functions
13531353
*
1354-
* @param mixed $args Data values
1354+
* @param mixed ...$args Data values
13551355
*
13561356
* @return float
13571357
*/

0 commit comments

Comments
 (0)