Skip to content

Commit

Permalink
Resolve merge conflicts for master -> 2.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBaker committed Sep 26, 2022
1 parent 541bf0f commit 73ca0e5
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 58 deletions.
3 changes: 2 additions & 1 deletion src/PhpSpreadsheet/Reader/Xlsx.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,12 @@ private static function castToString(?SimpleXMLElement $c): ?string
* @param mixed $value
* @param mixed $calculatedValue
*/
private function castToFormula(?SimpleXMLElement $c, string $r, string &$cellDataType, &$value, &$calculatedValue, array &$sharedFormulas, string $castBaseType): void
private function castToFormula(Worksheet $docSheet, ?SimpleXMLElement $c, string $r, string &$cellDataType, &$value, &$calculatedValue, array &$sharedFormulas, string $castBaseType): void
{
if ($c === null) {
return;
}

$formulaAttributes = $c->f->attributes();
$cellDataType = 'f';
$value = "={$c->f}";
Expand Down
12 changes: 6 additions & 6 deletions tests/PhpSpreadsheetTests/Calculation/ArrayFormulaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,27 @@ public function providerArrayArithmetic(): array
],
'Division: row vector / column vector' => [
'={1,2,3} / {4;5;6}',
[[0.25, 0.5, 0.75], [0.2, 0.4, 0.6], [0.16666666666667, 0.33333333333333, 0.5]],
[[0.25, 0.5, 0.75], [0.2, 0.4, 0.6], [0.16666666666666667, 0.3333333333333333, 0.5]],
],
'Division: column vector / row vector' => [
'={1;2;3} / {4,5,6}',
[[0.25, 0.2, 0.16666666666667], [0.5, 0.4, 0.33333333333333], [0.75, 0.6, 0.5]],
[[0.25, 0.2, 0.16666666666666667], [0.5, 0.4, 0.3333333333333333], [0.75, 0.6, 0.5]],
],
'Division: matrix 3x2 / 3x2' => [
'={1,2,3;4,5,6} / {7,8,9;10,11,12}',
[[0.142857142857143, 0.25, 0.33333333333333], [0.4, 0.45454545454545, 0.5]],
[[0.14285714285714285, 0.25, 0.3333333333333333], [0.4, 0.45454545454545453, 0.5]],
],
'Division: matrix 2x3 / 2x3' => [
'={1,4;2,5;3,6} / {7,10;8,11;9,12}',
[[0.142857142857143, 0.4], [0.25, 0.45454545454545], [0.33333333333333, 0.5]],
[[0.14285714285714285, 0.4], [0.25, 0.45454545454545453], [0.3333333333333333, 0.5]],
],
'Division: row vector 2 / column vector 2' => [
'={2,3} / {4;5}',
[[0.5, 0.75], [0.4, 0.6]],
],
'Division: matrix 3x2 / 2x3' => [
'={1,2,3;4,5,6} / {7,10;8,11;9,12}',
[[0.14285714285714, 0.2], [0.5, 0.45454545454545]],
[[0.14285714285714285, 0.2], [0.5, 0.45454545454545453]],
],
'Division: matrix 2x3 / 3x2' => [
'={7,10;8,11;9,12} / {1,2,3;4,5,6}',
Expand All @@ -289,7 +289,7 @@ public function providerArrayArithmetic(): array
// Power
'Power: square matrix 2x2 ^ 2x2' => [
'={1,2;3,4} ^ {-2,4;-6,8}',
[[1, 16], [0.00137174211248, 65536]],
[[1, 16], [0.0013717421124828531, 65536]],
],
'Power: square matrix 2x2 ^ scalar' => [
'={1,2;3,4} ^ 2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
use PHPUnit\Framework\TestCase;

class ConvertUoMTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ErfC;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
use PHPUnit\Framework\TestCase;

class ErfCTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
use PHPUnit\Framework\TestCase;

class ErfPreciseTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
use PHPUnit\Framework\TestCase;

class ErfTest extends TestCase
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PHPUnit\Framework\TestCase;

class IrrTest extends TestCase
class IrrTest extends AllSetupTeardown
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Address;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;

class AddressTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;

class ColumnsTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Matrix;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;

class IndexTest extends TestCase
Expand All @@ -17,7 +15,7 @@ class IndexTest extends TestCase
*/
public function testINDEX($expectedResult, ...$args): void
{
$result = LookupRef::INDEX(/** @scrutinizer ignore-type */ ...$args);
$result = Matrix::index(/** @scrutinizer ignore-type */ ...$args);
self::assertEquals($expectedResult, $result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use PhpOffice\PhpSpreadsheet\NamedRange;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as ReaderXlsx;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Indirect;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

class IndirectTest extends AllSetupTeardown
{
Expand Down Expand Up @@ -123,16 +125,6 @@ public function testIndirectFile2(): void
}
}

public function testDeprecatedCall(): void
{
$sheet = $this->getSheet();
$sheet->getCell('A1')->setValue('A2');
$sheet->getCell('A2')->setValue('This is it');
$result = \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT('A2', $sheet->getCell('A1'));
$result = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenSingleValue($result);
self::assertSame('This is it', $result);
}

/**
* @param null|int|string $expectedResult
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;

class RowsTest extends TestCase
Expand All @@ -17,7 +15,7 @@ class RowsTest extends TestCase
*/
public function testROWS($expectedResult, ...$args): void
{
$result = LookupRef::ROWS(/** @scrutinizer ignore-type */ ...$args);
$result = RowColumnInformation::rows(/** @scrutinizer ignore-type */ ...$args);
self::assertEquals($expectedResult, $result);
}

Expand Down

0 comments on commit 73ca0e5

Please sign in to comment.