From 34675bdf5d736ee796abf552e75a1660cfab4b66 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 12 Aug 2019 10:03:41 -0700 Subject: [PATCH] Remove dead code --- src/PhpSpreadsheet/Calculation/Calculation.php | 1 - tests/data/Calculation/Calculation.php | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 449553a4..a131fca9 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -3592,7 +3592,6 @@ class Calculation $valToUpper = strtoupper($val); // here $matches[1] will contain values like "IF" // and $val "IF(" - $injectStoreKey = null; if ($this->branchPruningEnabled && ($valToUpper == 'IF(')) { // we handle a new if $pendingStoreKey = $this->getUnusedBranchStoreKey(); $pendingStoreKeysStack[] = $pendingStoreKey; diff --git a/tests/data/Calculation/Calculation.php b/tests/data/Calculation/Calculation.php index 09538c3c..201df47a 100644 --- a/tests/data/Calculation/Calculation.php +++ b/tests/data/Calculation/Calculation.php @@ -14,8 +14,6 @@ function calculationTestDataGenerator() $formula1 = '=IF(A1="please +",SUM(A2:C2),7 + IF(B1="please *", 4, 2))'; $set2 = [3, $dataArray1, $formula1, 'E5']; - $originalDataArray = $dataArray1; - $dataArray1[0][0] = 'not please + something else'; $set3 = [11, $dataArray1, $formula1, 'E5']; @@ -39,11 +37,11 @@ function calculationTestDataGenerator() $dataArray4 = [ ['noflag', 0, 0], [127000, 0, 0], - [ 10000, 0.03, 0], - [ 20000, 0.06, 0], - [ 40000, 0.09, 0], - [ 70000, 0.12, 0], - [ 90000, 0.03, 0] + [10000, 0.03, 0], + [20000, 0.06, 0], + [40000, 0.09, 0], + [70000, 0.12, 0], + [90000, 0.03, 0], ]; $formula2 = '=IF(A1="flag",IF(A2<10, 0) + IF(A3<10000, 0))'; $set7 = [false, $dataArray4, $formula2, 'E5']; @@ -52,12 +50,12 @@ function calculationTestDataGenerator() [1, 2], [3, 4], ['=A1+A2', '=SUM(B1:B2)'], - [ 'take A', 0] + ['take A', 0], ]; $formula3 = '=IF(A4="take A", A3, B3)'; $set8 = [4, $dataArray5, $formula3, 'E5', ['A3'], ['B3']]; return [$set0, $set1, $set2, $set3, $set4, $set5, $set6, $set7, $set8]; -}; +} return calculationTestDataGenerator();