Skip to content

Commit 73ca0e5

Browse files
committed
Resolve merge conflicts for master -> 2.0-dev
1 parent 541bf0f commit 73ca0e5

File tree

13 files changed

+12
-58
lines changed

13 files changed

+12
-58
lines changed

src/PhpSpreadsheet/Reader/Xlsx.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,12 @@ private static function castToString(?SimpleXMLElement $c): ?string
320320
* @param mixed $value
321321
* @param mixed $calculatedValue
322322
*/
323-
private function castToFormula(?SimpleXMLElement $c, string $r, string &$cellDataType, &$value, &$calculatedValue, array &$sharedFormulas, string $castBaseType): void
323+
private function castToFormula(Worksheet $docSheet, ?SimpleXMLElement $c, string $r, string &$cellDataType, &$value, &$calculatedValue, array &$sharedFormulas, string $castBaseType): void
324324
{
325325
if ($c === null) {
326326
return;
327327
}
328+
328329
$formulaAttributes = $c->f->attributes();
329330
$cellDataType = 'f';
330331
$value = "={$c->f}";

tests/PhpSpreadsheetTests/Calculation/ArrayFormulaTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -260,27 +260,27 @@ public function providerArrayArithmetic(): array
260260
],
261261
'Division: row vector / column vector' => [
262262
'={1,2,3} / {4;5;6}',
263-
[[0.25, 0.5, 0.75], [0.2, 0.4, 0.6], [0.16666666666667, 0.33333333333333, 0.5]],
263+
[[0.25, 0.5, 0.75], [0.2, 0.4, 0.6], [0.16666666666666667, 0.3333333333333333, 0.5]],
264264
],
265265
'Division: column vector / row vector' => [
266266
'={1;2;3} / {4,5,6}',
267-
[[0.25, 0.2, 0.16666666666667], [0.5, 0.4, 0.33333333333333], [0.75, 0.6, 0.5]],
267+
[[0.25, 0.2, 0.16666666666666667], [0.5, 0.4, 0.3333333333333333], [0.75, 0.6, 0.5]],
268268
],
269269
'Division: matrix 3x2 / 3x2' => [
270270
'={1,2,3;4,5,6} / {7,8,9;10,11,12}',
271-
[[0.142857142857143, 0.25, 0.33333333333333], [0.4, 0.45454545454545, 0.5]],
271+
[[0.14285714285714285, 0.25, 0.3333333333333333], [0.4, 0.45454545454545453, 0.5]],
272272
],
273273
'Division: matrix 2x3 / 2x3' => [
274274
'={1,4;2,5;3,6} / {7,10;8,11;9,12}',
275-
[[0.142857142857143, 0.4], [0.25, 0.45454545454545], [0.33333333333333, 0.5]],
275+
[[0.14285714285714285, 0.4], [0.25, 0.45454545454545453], [0.3333333333333333, 0.5]],
276276
],
277277
'Division: row vector 2 / column vector 2' => [
278278
'={2,3} / {4;5}',
279279
[[0.5, 0.75], [0.4, 0.6]],
280280
],
281281
'Division: matrix 3x2 / 2x3' => [
282282
'={1,2,3;4,5,6} / {7,10;8,11;9,12}',
283-
[[0.14285714285714, 0.2], [0.5, 0.45454545454545]],
283+
[[0.14285714285714285, 0.2], [0.5, 0.45454545454545453]],
284284
],
285285
'Division: matrix 2x3 / 3x2' => [
286286
'={7,10;8,11;9,12} / {1,2,3;4,5,6}',
@@ -289,7 +289,7 @@ public function providerArrayArithmetic(): array
289289
// Power
290290
'Power: square matrix 2x2 ^ 2x2' => [
291291
'={1,2;3,4} ^ {-2,4;-6,8}',
292-
[[1, 16], [0.00137174211248, 65536]],
292+
[[1, 16], [0.0013717421124828531, 65536]],
293293
],
294294
'Power: square matrix 2x2 ^ scalar' => [
295295
'={1,2;3,4} ^ 2',

tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
66
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM;
7-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
8-
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
97
use PHPUnit\Framework\TestCase;
108

119
class ConvertUoMTest extends TestCase

tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
66
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ErfC;
7-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
8-
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
97
use PHPUnit\Framework\TestCase;
108

119
class ErfCTest extends TestCase

tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
66
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf;
7-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
8-
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
97
use PHPUnit\Framework\TestCase;
108

119
class ErfPreciseTest extends TestCase

tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
66
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf;
7-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
8-
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
97
use PHPUnit\Framework\TestCase;
108

119
class ErfTest extends TestCase

tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ParseComplexTest.php

-22
This file was deleted.

tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IrrTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
77
use PHPUnit\Framework\TestCase;
88

9-
class IrrTest extends TestCase
109
class IrrTest extends AllSetupTeardown
1110
{
1211
/**

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
76
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Address;
8-
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
97
use PHPUnit\Framework\TestCase;
108

119
class AddressTest extends TestCase

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
76
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation;
8-
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
97
use PHPUnit\Framework\TestCase;
108

119
class ColumnsTest extends TestCase

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
76
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Matrix;
8-
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
97
use PHPUnit\Framework\TestCase;
108

119
class IndexTest extends TestCase
@@ -17,7 +15,7 @@ class IndexTest extends TestCase
1715
*/
1816
public function testINDEX($expectedResult, ...$args): void
1917
{
20-
$result = LookupRef::INDEX(/** @scrutinizer ignore-type */ ...$args);
18+
$result = Matrix::index(/** @scrutinizer ignore-type */ ...$args);
2119
self::assertEquals($expectedResult, $result);
2220
}
2321

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use PhpOffice\PhpSpreadsheet\NamedRange;
66
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as ReaderXlsx;
7+
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Indirect;
8+
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
79

810
class IndirectTest extends AllSetupTeardown
911
{
@@ -123,16 +125,6 @@ public function testIndirectFile2(): void
123125
}
124126
}
125127

126-
public function testDeprecatedCall(): void
127-
{
128-
$sheet = $this->getSheet();
129-
$sheet->getCell('A1')->setValue('A2');
130-
$sheet->getCell('A2')->setValue('This is it');
131-
$result = \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT('A2', $sheet->getCell('A1'));
132-
$result = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenSingleValue($result);
133-
self::assertSame('This is it', $result);
134-
}
135-
136128
/**
137129
* @param null|int|string $expectedResult
138130
*

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
76
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation;
8-
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
97
use PHPUnit\Framework\TestCase;
108

119
class RowsTest extends TestCase
@@ -17,7 +15,7 @@ class RowsTest extends TestCase
1715
*/
1816
public function testROWS($expectedResult, ...$args): void
1917
{
20-
$result = LookupRef::ROWS(/** @scrutinizer ignore-type */ ...$args);
18+
$result = RowColumnInformation::rows(/** @scrutinizer ignore-type */ ...$args);
2119
self::assertEquals($expectedResult, $result);
2220
}
2321

0 commit comments

Comments
 (0)