Skip to content

Commit 5908326

Browse files
Merge branch 'PHPOffice:master' into Table-for-Xlsx
2 parents 4db8203 + de173d4 commit 5908326

38 files changed

+2241
-359
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
'braces' => true,
2222
'cast_spaces' => true,
2323
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // const are often grouped with other related const
24-
'class_definition' => true,
24+
'class_definition' => false,
2525
'class_keyword_remove' => false, // ::class keyword gives us better support in IDE
2626
'combine_consecutive_issets' => true,
2727
'combine_consecutive_unsets' => true,

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org).
99

1010
### Added
1111

12-
- Implementation of the FILTER(), SORT(), SORTBY() and UNIQUE() Lookup/Reference (array) functions
12+
- Introduced CellAddress, CellRange, RowRange and ColumnRange value objects that can be used as an alternative to a string value (e.g. `'C5'`, `'B2:D4'`, `'2:2'` or `'B:C'`) in appropriate contexts.
13+
- Implementation of the FILTER(), SORT(), SORTBY() and UNIQUE() Lookup/Reference (array) functions.
1314
- Implementation of the ISREF() Information function.
1415
- Added support for reading "formatted" numeric values from Csv files; although default behaviour of reading these values as strings is preserved.
1516

16-
(i.e a value of "12,345.67" can be read as numeric `1235.67`, not simply as a string `"12,345.67"`, if the `castFormattedNumberToNumeric()` setting is enabled.
17+
(i.e a value of "12,345.67" can be read as numeric `12345.67`, not simply as a string `"12,345.67"`, if the `castFormattedNumberToNumeric()` setting is enabled.
1718

1819
This functionality is locale-aware, using the server's locale settings to identify the thousands and decimal separators.
1920

@@ -37,13 +38,35 @@ and this project adheres to [Semantic Versioning](https://semver.org).
3738
### Deprecated
3839

3940
- All Excel Function implementations in `Calculation\Functions` (including the Error functions) have been moved to dedicated classes for groups of related functions. See the docblocks against all the deprecated methods for details of the new methods to call instead. At some point, these old classes will be deleted.
41+
- Worksheet methods that reference cells "byColumnandRow". All such methods have an equivalent that references the cell by its address (e.g. '`E3'` rather than `5, 3`).
42+
43+
These functions now accept either a cell address string (`'E3')` or an array with columnId and rowId (`[5, 3]`) or a new `CellAddress` object as their `cellAddress`/`coordinate` argument.
44+
This includes the methods:
45+
- `setCellValueByColumnAndRow()` use the equivalent `setCellValue()`
46+
- `setCellValueExplicitByColumnAndRow()` use the equivalent `setCellValueExplicit()`
47+
- `getCellByColumnAndRow()` use the equivalent `getCell()`
48+
- `cellExistsByColumnAndRow()` use the equivalent `cellExists()`
49+
- `getStyleByColumnAndRow()` use the equivalent `getStyle()`
50+
- `setBreakByColumnAndRow()` use the equivalent `setBreak()`
51+
- `mergeCellsByColumnAndRow()` use the equivalent `mergeCells()`
52+
- `unmergeCellsByColumnAndRow()` use the equivalent `unmergeCells()`
53+
- `protectCellsByColumnAndRow()` use the equivalent `protectCells()`
54+
- `unprotectCellsByColumnAndRow()` use the equivalent `unprotectCells()`
55+
- `setAutoFilterByColumnAndRow()` use the equivalent `setAutoFilter()`
56+
- `freezePaneByColumnAndRow()` use the equivalent `freezePane()`
57+
- `getCommentByColumnAndRow()` use the equivalent `getComment()`
58+
- `setSelectedCellByColumnAndRow()` use the equivalent `setSelectedCells()`
59+
60+
This change provides more consistency in the methods (not every "by cell address" method has an equivalent "byColumnAndRow" method);
61+
and the "by cell address" methods often provide more flexibility, such as allowing a range of cells, or referencing them by passing the defined name of a named range as the argument.
4062

4163
### Removed
4264

4365
- Nothing
4466

4567
### Fixed
4668

69+
- Support for "chained" ranges (e.g. `A5:C10:C20:F1`) in the Calculation Engine; and also support for using named ranges with the Range operator (e.g. `NamedRange1:NamedRange2`) [Issue #2730](https://github.com/PHPOffice/PhpSpreadsheet/issues/2730) [PR #2746](https://github.com/PHPOffice/PhpSpreadsheet/pull/2746)
4770
- Update Conditional Formatting ranges and rule conditions when inserting/deleting rows/columns [Issue #2678](https://github.com/PHPOffice/PhpSpreadsheet/issues/2678) [PR #2689](https://github.com/PHPOffice/PhpSpreadsheet/pull/2689)
4871
- Allow `INDIRECT()` to accept row/column ranges as well as cell ranges [PR #2687](https://github.com/PHPOffice/PhpSpreadsheet/pull/2687)
4972
- Fix bug when deleting cells with hyperlinks, where the hyperlink was then being "inherited" by whatever cell moved to that cell address.
@@ -57,6 +80,8 @@ and this project adheres to [Semantic Versioning](https://semver.org).
5780

5881
Nor is this a perfect solution, as there may still be issues when function calls have array arguments that themselves contain function calls; but it's still better than the current logic.
5982
- Fix for escaping double quotes within a formula [Issue #1971](https://github.com/PHPOffice/PhpSpreadsheet/issues/1971) [PR #2651](https://github.com/PHPOffice/PhpSpreadsheet/pull/2651)
83+
- Fix invalid style of cells in empty columns with columnDimensions and rows with rowDimensions in added external sheet. [PR #2739](https://github.com/PHPOffice/PhpSpreadsheet/pull/2739)
84+
6085

6186
## 1.22.0 - 2022-02-18
6287

composer.lock

Lines changed: 16 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ parameters:
127127

128128
-
129129
message: "#^Offset 'value' does not exist on array\\|null\\.$#"
130-
count: 3
130+
count: 5
131131
path: src/PhpSpreadsheet/Calculation/Calculation.php
132132

133133
-
@@ -340,11 +340,6 @@ parameters:
340340
count: 1
341341
path: src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
342342

343-
-
344-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\BesselK\\:\\:besselK2\\(\\) has no return type specified\\.$#"
345-
count: 1
346-
path: src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
347-
348343
-
349344
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBase\\:\\:validatePlaces\\(\\) has parameter \\$places with no type specified\\.$#"
350345
count: 1
@@ -2070,11 +2065,6 @@ parameters:
20702065
count: 1
20712066
path: src/PhpSpreadsheet/Reader/Ods.php
20722067

2073-
-
2074-
message: "#^If condition is always true\\.$#"
2075-
count: 1
2076-
path: src/PhpSpreadsheet/Reader/Ods.php
2077-
20782068
-
20792069
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\:\\:listWorksheetNames\\(\\) should return array\\<string\\> but returns array\\<int, string\\|null\\>\\.$#"
20802070
count: 1
@@ -2095,11 +2085,6 @@ parameters:
20952085
count: 1
20962086
path: src/PhpSpreadsheet/Reader/Ods.php
20972087

2098-
-
2099-
message: "#^While loop condition is always true\\.$#"
2100-
count: 2
2101-
path: src/PhpSpreadsheet/Reader/Ods.php
2102-
21032088
-
21042089
message: "#^Cannot call method getElementsByTagNameNS\\(\\) on DOMElement\\|null\\.$#"
21052090
count: 3
@@ -3880,11 +3865,6 @@ parameters:
38803865
count: 1
38813866
path: src/PhpSpreadsheet/Shared/Trend/Trend.php
38823867

3883-
-
3884-
message: "#^Parameter \\#1 \\$order of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\PolynomialBestFit constructor expects int, string given\\.$#"
3885-
count: 2
3886-
path: src/PhpSpreadsheet/Shared/Trend/Trend.php
3887-
38883868
-
38893869
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\XMLWriter\\:\\:getData\\(\\) should return string but returns string\\|false\\.$#"
38903870
count: 1
@@ -4345,11 +4325,6 @@ parameters:
43454325
count: 1
43464326
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
43474327

4348-
-
4349-
message: "#^Result of && is always true\\.$#"
4350-
count: 1
4351-
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
4352-
43534328
-
43544329
message: "#^Right side of && is always true\\.$#"
43554330
count: 1

0 commit comments

Comments
 (0)