Skip to content

Commit 74dca30

Browse files
authored
Merge pull request PHPOffice#4399 from oleibman/stan2lv902
Phpstan Level 9 - Part 2 of Many
2 parents b1beafb + c84960f commit 74dca30

37 files changed

+107
-470
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 384 deletions
Large diffs are not rendered by default.

samples/Engineering/BESSELI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
$formula = "BESSELI({$x}, {$n})";
2222
$worksheet->setCellValue('A1', "=$formula");
2323

24-
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValue());
24+
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValueString());
2525
}
2626
}

samples/Engineering/BESSELJ.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
$formula = "BESSELJ({$x}, {$n})";
2222
$worksheet->setCellValue('A1', "=$formula");
2323

24-
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValue());
24+
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValueString());
2525
}
2626
}

samples/Engineering/BESSELK.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
$formula = "BESSELK({$x}, {$n})";
2222
$worksheet->setCellValue('A1', "=$formula");
2323

24-
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValue());
24+
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValueString());
2525
}
2626
}

samples/Engineering/BESSELY.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
$formula = "BESSELY({$x}, {$n})";
2222
$worksheet->setCellValue('A1', "=$formula");
2323

24-
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValue());
24+
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValueString());
2525
}
2626
}

samples/Engineering/CONVERT.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@
4040
for ($row = 1; $row <= $testDataCount; ++$row) {
4141
$helper->log(
4242
"(A$row): Unit of Measure Conversion Formula "
43-
. $worksheet->getCell('D' . $row)->getValue()
43+
. $worksheet->getCell('D' . $row)->getValueString()
4444
. ' - '
45-
. $worksheet->getCell('A' . $row)->getValue()
45+
. $worksheet->getCell('A' . $row)->getValueString()
4646
. ' '
47-
. $worksheet->getCell('B' . $row)->getValue()
47+
. $worksheet->getCell('B' . $row)->getValueString()
4848
. ' is '
49-
. $worksheet->getCell('D' . $row)->getCalculatedValue()
49+
. $worksheet->getCell('D' . $row)->getCalculatedValueString()
5050
. ' '
51-
. $worksheet->getCell('C' . $row)->getValue()
51+
. $worksheet->getCell('C' . $row)->getValueString()
5252
);
5353
}
5454

5555
$helper->log('Old method for area conversions, before MS Excel introduced area Units of Measure');
5656

5757
$helper->log(
5858
"(A$row): Unit of Measure Conversion Formula "
59-
. $worksheet->getCell('H1')->getValue()
59+
. $worksheet->getCell('H1')->getValueString()
6060
. ' result is '
61-
. $worksheet->getCell('H1')->getCalculatedValue()
61+
. $worksheet->getCell('H1')->getCalculatedValueString()
6262
);

samples/Engineering/Convert-Online.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM;
44
use PhpOffice\PhpSpreadsheet\Helper\Sample;
55
use PhpOffice\PhpSpreadsheet\Settings;
6+
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
67

78
require __DIR__ . '/../Header.php';
89

@@ -12,9 +13,14 @@
1213

1314
return;
1415
}
15-
16+
$post = [];
17+
foreach (['category', 'quantity', 'fromUnit', 'toUnit'] as $value) {
18+
if (isset($_POST[$value])) {
19+
$post[$value] = StringHelper::convertToString($_POST[$value]);
20+
}
21+
}
1622
$categories = ConvertUOM::getConversionCategories();
17-
$defaultCategory = $_POST['category'] ?? $categories[0];
23+
$defaultCategory = $post['category'] ?? $categories[0];
1824
$units = [];
1925
foreach ($categories as $category) {
2026
$categoryUnits = ConvertUOM::getConversionCategoryUnitDetails($category)[$category];
@@ -34,23 +40,23 @@
3440
<div class="col-sm-10">
3541
<select name="category" class="form-select" onchange="this.form.submit()">
3642
<?php foreach ($categories as $category) {
37-
echo "<option value=\"{$category}\" " . ((isset($_POST['category']) && $_POST['category'] === $category) ? 'selected' : '') . ">{$category}</option>", PHP_EOL;
43+
echo "<option value=\"{$category}\" " . ((isset($post['category']) && $post['category'] === $category) ? 'selected' : '') . ">{$category}</option>", PHP_EOL;
3844
} ?>
3945
</select>
4046
</div>
4147
</div>
4248
<div class="mb-3 row">
4349
<label for="quantity" class="col-sm-2 col-form-label">Quantity</label>
4450
<div class="col-sm-10">
45-
<input name="quantity" type="text" size="8" value="<?php echo (isset($_POST['quantity'])) ? htmlentities($_POST['quantity'], Settings::htmlEntityFlags()) : '1.0'; ?>">
51+
<input name="quantity" type="text" size="8" value="<?php echo (isset($post['quantity'])) ? htmlentities($post['quantity'], Settings::htmlEntityFlags()) : '1.0'; ?>">
4652
</div>
4753
</div>
4854
<div class="mb-3 row">
4955
<label for="fromUnit" class="col-sm-2 col-form-label">From Unit</label>
5056
<div class="col-sm-10">
5157
<select name="fromUnit" class="form-select">
5258
<?php foreach ($units[$defaultCategory] as $fromUnitCode => $fromUnitName) {
53-
echo "<option value=\"{$fromUnitCode}\" " . ((isset($_POST['fromUnit']) && $_POST['fromUnit'] === $fromUnitCode) ? 'selected' : '') . ">{$fromUnitName}</option>", PHP_EOL;
59+
echo "<option value=\"{$fromUnitCode}\" " . ((isset($post['fromUnit']) && $post['fromUnit'] === $fromUnitCode) ? 'selected' : '') . ">{$fromUnitName}</option>", PHP_EOL;
5460
} ?>
5561
</select>
5662
</div>
@@ -60,7 +66,7 @@
6066
<div class="col-sm-10">
6167
<select name="toUnit" class="form-select">
6268
<?php foreach ($units[$defaultCategory] as $toUnitCode => $toUnitName) {
63-
echo "<option value=\"{$toUnitCode}\" " . ((isset($_POST['toUnit']) && $_POST['toUnit'] === $toUnitCode) ? 'selected' : '') . ">{$toUnitName}</option>", PHP_EOL;
69+
echo "<option value=\"{$toUnitCode}\" " . ((isset($post['toUnit']) && $post['toUnit'] === $toUnitCode) ? 'selected' : '') . ">{$toUnitName}</option>", PHP_EOL;
6470
} ?>
6571
</select>
6672
</div>
@@ -74,17 +80,17 @@
7480

7581
<?php
7682
/** If the user has submitted the form, then we need to calculate the value and display the result */
77-
if (isset($_POST['quantity'], $_POST['fromUnit'], $_POST['toUnit'])) {
78-
$quantity = $_POST['quantity'];
79-
$fromUnit = $_POST['fromUnit'];
80-
$toUnit = $_POST['toUnit'];
83+
if (isset($post['quantity'], $post['fromUnit'], $post['toUnit'])) {
84+
$quantity = $post['quantity'];
85+
$fromUnit = $post['fromUnit'];
86+
$toUnit = $post['toUnit'];
8187
if (!is_numeric($quantity)) {
8288
$helper->log('Quantity is not numeric');
83-
} elseif (isset($units[$_POST['category']][$fromUnit], $units[$_POST['category']][$toUnit])) {
89+
} elseif (isset($units[$post['category']][$fromUnit], $units[$post['category']][$toUnit])) {
8490
/** @var float|string */
8591
$result = ConvertUOM::CONVERT($quantity, $fromUnit, $toUnit);
8692

87-
$helper->log("{$quantity} {$units[$_POST['category']][$fromUnit]} is {$result} {$units[$_POST['category']][$toUnit]}");
93+
$helper->log("{$quantity} {$units[$post['category']][$fromUnit]} is {$result} {$units[$post['category']][$toUnit]}");
8894
} else {
8995
$helper->log('Please enter quantity and select From Unit and To Unit');
9096
}

samples/Engineering/DELTA.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
for ($row = 1; $row <= $testDataCount; ++$row) {
3838
$helper->log(
3939
"(E$row): Compare values "
40-
. $worksheet->getCell('A' . $row)->getValue()
40+
. $worksheet->getCell('A' . $row)->getValueString()
4141
. ' and '
42-
. $worksheet->getCell('B' . $row)->getValue()
42+
. $worksheet->getCell('B' . $row)->getValueString()
4343
. ' - Result is '
44-
. $worksheet->getCell('C' . $row)->getCalculatedValue()
44+
. $worksheet->getCell('C' . $row)->getCalculatedValueString()
4545
. ' - '
46-
. $comparison[$worksheet->getCell('C' . $row)->getCalculatedValue()]
46+
. $comparison[$worksheet->getCell('C' . $row)->getCalculatedValueString()]
4747
);
4848
}

samples/Engineering/ERF.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,24 @@
4747
for ($row = 1; $row <= $testDataCount1; ++$row) {
4848
$helper->log(
4949
"(C$row): "
50-
. $worksheet->getCell('C' . $row)->getValue()
50+
. $worksheet->getCell('C' . $row)->getValueString()
5151
. ' The error function integrated between 0 and '
52-
. $worksheet->getCell('A' . $row)->getValue()
52+
. $worksheet->getCell('A' . $row)->getValueString()
5353
. ' is '
54-
. $worksheet->getCell('C' . $row)->getCalculatedValue()
54+
. $worksheet->getCell('C' . $row)->getCalculatedValueString()
5555
);
5656
}
5757

5858
$helper->log('ERF() With two arguments');
5959
for ($row = $testDataCount1 + 1; $row <= $testDataCount2 + $testDataCount1; ++$row) {
6060
$helper->log(
6161
"(C$row): "
62-
. $worksheet->getCell('C' . $row)->getValue()
62+
. $worksheet->getCell('C' . $row)->getValueString()
6363
. ' The error function integrated between '
64-
. $worksheet->getCell('A' . $row)->getValue()
64+
. $worksheet->getCell('A' . $row)->getValueString()
6565
. ' and '
66-
. $worksheet->getCell('B' . $row)->getValue()
66+
. $worksheet->getCell('B' . $row)->getValueString()
6767
. ' is '
68-
. $worksheet->getCell('C' . $row)->getCalculatedValue()
68+
. $worksheet->getCell('C' . $row)->getCalculatedValueString()
6969
);
7070
}

samples/Engineering/ERFC.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
for ($row = 1; $row <= $testDataCount; ++$row) {
3434
$helper->log(
3535
"(E$row): "
36-
. $worksheet->getCell('C' . $row)->getValue()
36+
. $worksheet->getCell('C' . $row)->getValueString()
3737
. ' The complementary error function integrated by '
38-
. $worksheet->getCell('A' . $row)->getValue()
38+
. $worksheet->getCell('A' . $row)->getValueString()
3939
. ' and infinity is '
40-
. $worksheet->getCell('C' . $row)->getCalculatedValue()
40+
. $worksheet->getCell('C' . $row)->getCalculatedValueString()
4141
);
4242
}

samples/HexEtcConversions/BIN2DEC.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
for ($row = 1; $row <= $testDataCount; ++$row) {
4040
$helper->log(
4141
"(B$row): "
42-
. 'Binary ' . $worksheet->getCell("A$row")->getValue()
43-
. ' is decimal ' . $worksheet->getCell("B$row")->getCalculatedValue()
42+
. 'Binary ' . $worksheet->getCell("A$row")->getValueString()
43+
. ' is decimal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4444
);
4545
}

samples/HexEtcConversions/BIN2HEX.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
for ($row = 1; $row <= $testDataCount; ++$row) {
4040
$helper->log(
4141
"(B$row): "
42-
. 'Binary ' . $worksheet->getCell("A$row")->getValue()
43-
. ' is hexadecimal ' . $worksheet->getCell("B$row")->getCalculatedValue()
42+
. 'Binary ' . $worksheet->getCell("A$row")->getValueString()
43+
. ' is hexadecimal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4444
);
4545
}

samples/HexEtcConversions/BIN2OCT.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
for ($row = 1; $row <= $testDataCount; ++$row) {
4040
$helper->log(
4141
"(B$row): "
42-
. 'Binary ' . $worksheet->getCell("A$row")->getValue()
43-
. ' is octal ' . $worksheet->getCell("B$row")->getCalculatedValue()
42+
. 'Binary ' . $worksheet->getCell("A$row")->getValueString()
43+
. ' is octal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4444
);
4545
}

samples/HexEtcConversions/DEC2BIN.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
for ($row = 1; $row <= $testDataCount; ++$row) {
4141
$helper->log(
4242
"(B$row): "
43-
. 'Decimal ' . $worksheet->getCell("A$row")->getValue()
44-
. ' is binary ' . $worksheet->getCell("B$row")->getCalculatedValue()
43+
. 'Decimal ' . $worksheet->getCell("A$row")->getValueString()
44+
. ' is binary ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4545
);
4646
}

samples/HexEtcConversions/DEC2HEX.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
for ($row = 1; $row <= $testDataCount; ++$row) {
4242
$helper->log(
4343
"(B$row): "
44-
. 'Decimal ' . $worksheet->getCell("A$row")->getValue()
45-
. ' is hexadecimal ' . $worksheet->getCell("B$row")->getCalculatedValue()
44+
. 'Decimal ' . $worksheet->getCell("A$row")->getValueString()
45+
. ' is hexadecimal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4646
);
4747
}

samples/HexEtcConversions/DEC2OCT.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
for ($row = 1; $row <= $testDataCount; ++$row) {
4242
$helper->log(
4343
"(B$row): "
44-
. 'Decimal ' . $worksheet->getCell("A$row")->getValue()
45-
. ' is octal ' . $worksheet->getCell("B$row")->getCalculatedValue()
44+
. 'Decimal ' . $worksheet->getCell("A$row")->getValueString()
45+
. ' is octal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4646
);
4747
}

samples/HexEtcConversions/HEX2BIN.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
for ($row = 1; $row <= $testDataCount; ++$row) {
4040
$helper->log(
4141
"(B$row): "
42-
. 'Hexadecimal ' . $worksheet->getCell("A$row")->getValue()
43-
. ' is binary ' . $worksheet->getCell("B$row")->getCalculatedValue()
42+
. 'Hexadecimal ' . $worksheet->getCell("A$row")->getValueString()
43+
. ' is binary ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4444
);
4545
}

samples/HexEtcConversions/HEX2DEC.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
for ($row = 1; $row <= $testDataCount; ++$row) {
4242
$helper->log(
4343
"(B$row): "
44-
. 'Hexadecimal ' . $worksheet->getCell("A$row")->getValue()
45-
. ' is decimal ' . $worksheet->getCell("B$row")->getCalculatedValue()
44+
. 'Hexadecimal ' . $worksheet->getCell("A$row")->getValueString()
45+
. ' is decimal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4646
);
4747
}

samples/HexEtcConversions/HEX2OCT.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
for ($row = 1; $row <= $testDataCount; ++$row) {
4040
$helper->log(
4141
"(B$row): "
42-
. 'Hexadecimal ' . $worksheet->getCell("A$row")->getValue()
43-
. ' is octal ' . $worksheet->getCell("B$row")->getCalculatedValue()
42+
. 'Hexadecimal ' . $worksheet->getCell("A$row")->getValueString()
43+
. ' is octal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4444
);
4545
}

samples/HexEtcConversions/OCT2BIN.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
for ($row = 1; $row <= $testDataCount; ++$row) {
4141
$helper->log(
4242
"(B$row): "
43-
. 'Octal ' . $worksheet->getCell("A$row")->getValue()
44-
. ' is binary ' . $worksheet->getCell("B$row")->getCalculatedValue()
43+
. 'Octal ' . $worksheet->getCell("A$row")->getValueString()
44+
. ' is binary ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4545
);
4646
}

samples/HexEtcConversions/OCT2DEC.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
for ($row = 1; $row <= $testDataCount; ++$row) {
4343
$helper->log(
4444
"(B$row): "
45-
. 'Octal ' . $worksheet->getCell("A$row")->getValue()
46-
. ' is decimal ' . $worksheet->getCell("B$row")->getCalculatedValue()
45+
. 'Octal ' . $worksheet->getCell("A$row")->getValueString()
46+
. ' is decimal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4747
);
4848
}

samples/HexEtcConversions/OCT2HEX.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
for ($row = 1; $row <= $testDataCount; ++$row) {
4343
$helper->log(
4444
"(B$row): "
45-
. 'Octal ' . $worksheet->getCell("A$row")->getValue()
46-
. ' is hexadecimal ' . $worksheet->getCell("B$row")->getCalculatedValue()
45+
. 'Octal ' . $worksheet->getCell("A$row")->getValueString()
46+
. ' is hexadecimal ' . $worksheet->getCell("B$row")->getCalculatedValueString()
4747
);
4848
}

samples/LookupRef/ADDRESS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
for ($row = 1; $row <= 5; ++$row) {
2020
$cell = $worksheet->getCell("A{$row}");
21-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
21+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
2222
}

samples/LookupRef/COLUMN.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
for ($row = 1; $row <= 2; ++$row) {
2323
$cell = $worksheet->getCell("A{$row}");
24-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
24+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
2525
}
2626

2727
$cell = $worksheet->getCell('F1');
28-
$helper->log('F1: ' . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
28+
$helper->log('F1: ' . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());

samples/LookupRef/COLUMNS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717

1818
for ($row = 1; $row <= 4; ++$row) {
1919
$cell = $worksheet->getCell("A{$row}");
20-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
20+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
2121
}

samples/LookupRef/INDEX.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535

3636
for ($row = 11; $row <= 16; ++$row) {
3737
$cell = $worksheet->getCell("A{$row}");
38-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
38+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
3939
}

samples/LookupRef/INDIRECT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929

3030
for ($row = 1; $row <= 5; ++$row) {
3131
$cell = $worksheet->getCell("A{$row}");
32-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
32+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
3333
}

samples/LookupRef/OFFSET.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929

3030
for ($row = 1; $row <= 4; ++$row) {
3131
$cell = $worksheet->getCell("H{$row}");
32-
$helper->log("H{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
32+
$helper->log("H{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
3333
}

samples/LookupRef/ROW.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
for ($row = 1; $row <= 3; ++$row) {
1818
$cell = $worksheet->getCell("A{$row}");
19-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
19+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
2020
}

samples/LookupRef/ROWS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
for ($row = 1; $row <= 3; ++$row) {
1818
$cell = $worksheet->getCell("A{$row}");
19-
$helper->log("A{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
19+
$helper->log("A{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
2020
}

samples/LookupRef/VLOOKUP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
for ($column = 'H'; $column !== 'K'; ++$column) {
4444
for ($row = 4; $row <= 5; ++$row) {
4545
$cell = $worksheet->getCell("{$column}{$row}");
46-
$helper->log("{$column}{$row}: " . $cell->getValue() . ' => ' . $cell->getCalculatedValue());
46+
$helper->log("{$column}{$row}: " . $cell->getValueString() . ' => ' . $cell->getCalculatedValueString());
4747
}
4848
}

0 commit comments

Comments
 (0)