Skip to content

Commit d613de1

Browse files
author
MarkBaker
committed
Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts: # docs/references/function-list-by-category.md # docs/references/function-list-by-name.md # phpstan-baseline.neon # src/PhpSpreadsheet/Worksheet/Worksheet.php
2 parents c0c79c7 + 7169648 commit d613de1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3582
-508
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ $spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
2626

2727
// add code that show the issue here...
2828
```
29+
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
30+
31+
### What features do you think are causing the issue
32+
33+
- [ ] Reader
34+
- [ ] Writer
35+
- [ ] Styles
36+
- [ ] Data Validations
37+
- [ ] Formula Calulations
38+
- [ ] Charts
39+
- [ ] AutoFilter
40+
- [ ] Form Elements
41+
42+
### Does an issue affect all spreadsheet file formats? If not, which formats are affected?
2943

3044

3145
### Which versions of PhpSpreadsheet and PHP are affected?

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ This is:
33
```
44
- [ ] a bugfix
55
- [ ] a new feature
6+
- [ ] refactoring
7+
- [ ] additional unit tests
68
```
79

810
Checklist:
911

1012
- [ ] Changes are covered by unit tests
13+
- [ ] Changes are covered by existing unit tests
14+
- [ ] New unit tests have been added
1115
- [ ] Code style is respected
1216
- [ ] Commit message explains **why** the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
1317
- [ ] CHANGELOG.md contains a short summary of the change
1418
- [ ] Documentation is updated as necessary
1519

1620
### Why this change is needed?
21+
22+
Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
23+
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.

CHANGELOG.md

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

1010
### Added
1111

12+
- Nothing
13+
14+
### Changed
15+
16+
- Nothing
17+
18+
### Deprecated
19+
20+
- Nothing
21+
22+
### Removed
23+
24+
- Nothing
25+
26+
### Fixed
27+
28+
- Nothing
29+
30+
31+
## 1.23.0 - 2022-04-24
32+
33+
### Added
34+
35+
- Ods Writer support for Freeze Pane [Issue #2013](https://github.com/PHPOffice/PhpSpreadsheet/issues/2013) [PR #2755](https://github.com/PHPOffice/PhpSpreadsheet/pull/2755)
36+
- Ods Writer support for setting column width/row height (including the use of AutoSize) [Issue #2346](https://github.com/PHPOffice/PhpSpreadsheet/issues/2346) [PR #2753](https://github.com/PHPOffice/PhpSpreadsheet/pull/2753)
1237
- 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.
1338
- Implementation of the FILTER(), SORT(), SORTBY() and UNIQUE() Lookup/Reference (array) functions.
1439
- Implementation of the ISREF() Information function.
@@ -18,11 +43,18 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1843

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

21-
- Support for two cell anchor drawing of images. [#2532](https://github.com/PHPOffice/PhpSpreadsheet/pull/2532)
46+
- Support for two cell anchor drawing of images. [#2532](https://github.com/PHPOffice/PhpSpreadsheet/pull/2532) [#2674](https://github.com/PHPOffice/PhpSpreadsheet/pull/2674)
2247
- Limited support for Xls Reader to handle Conditional Formatting:
2348

2449
Ranges and Rules are read, but style is currently limited to font size, weight and color; and to fill style and color.
2550

51+
- Add ability to suppress Mac line ending check for CSV [#2623](https://github.com/PHPOffice/PhpSpreadsheet/pull/2623)
52+
- Initial support for creating and writing Tables (Xlsx Writer only) [PR #2671](https://github.com/PHPOffice/PhpSpreadsheet/pull/2671)
53+
54+
See `/samples/Table` for examples of use.
55+
56+
Note that PreCalculateFormulas needs to be disabled when saving spreadsheets containing tables with formulae (totals or column formulae).
57+
2658
### Changed
2759

2860
- Gnumeric Reader now loads number formatting for cells.
@@ -66,22 +98,28 @@ and this project adheres to [Semantic Versioning](https://semver.org).
6698

6799
### Fixed
68100

101+
- Make allowance for the AutoFilter dropdown icon in the first row of an Autofilter range when using Autosize columns. [Issue #2413](https://github.com/PHPOffice/PhpSpreadsheet/issues/2413) [PR #2754](https://github.com/PHPOffice/PhpSpreadsheet/pull/2754)
69102
- 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)
70103
- 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)
71104
- Allow `INDIRECT()` to accept row/column ranges as well as cell ranges [PR #2687](https://github.com/PHPOffice/PhpSpreadsheet/pull/2687)
72105
- Fix bug when deleting cells with hyperlinks, where the hyperlink was then being "inherited" by whatever cell moved to that cell address.
73106
- Fix bug in Conditional Formatting in the Xls Writer that resulted in a broken file when there were multiple conditional ranges in a worksheet.
74107
- Fix Conditional Formatting in the Xls Writer to work with rules that contain string literals, cell references and formulae.
75108
- Fix for setting Active Sheet to the first loaded worksheet when bookViews element isn't defined [Issue #2666](https://github.com/PHPOffice/PhpSpreadsheet/issues/2666) [PR #2669](https://github.com/PHPOffice/PhpSpreadsheet/pull/2669)
76-
- Fixed behaviour of XLSX font style vertical align settings.
109+
- Fixed behaviour of XLSX font style vertical align settings [PR #2619](https://github.com/PHPOffice/PhpSpreadsheet/pull/2619)
77110
- Resolved formula translations to handle separators (row and column) for array functions as well as for function argument separators; and cleanly handle nesting levels.
78111

79112
Note that this method is used when translating Excel functions between `en_us` and other locale languages, as well as when converting formulae between different spreadsheet formats (e.g. Ods to Excel).
80113

81114
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.
82115
- 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)
116+
- Change open mode for output from `wb+` to `wb` [Issue #2372](https://github.com/PHPOffice/PhpSpreadsheet/issues/2372) [PR #2657](https://github.com/PHPOffice/PhpSpreadsheet/pull/2657)
117+
- Use color palette if supplied [Issue #2499](https://github.com/PHPOffice/PhpSpreadsheet/issues/2499) [PR #2595](https://github.com/PHPOffice/PhpSpreadsheet/pull/2595)
118+
- Xls reader treat drawing offsets as int rather than float [PR #2648](https://github.com/PHPOffice/PhpSpreadsheet/pull/2648)
119+
- Handle booleans in conditional styles properly [PR #2654](https://github.com/PHPOffice/PhpSpreadsheet/pull/2654)
120+
- Fix for reading files in the root directory of a ZipFile, which should not be prefixed by relative paths ("./") as dirname($filename) does by default.
83121
- 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-
122+
- Time Interval Formatting [Issue #2768](https://github.com/PHPOffice/PhpSpreadsheet/issues/2768) [PR #2772](https://github.com/PHPOffice/PhpSpreadsheet/pull/2772)
85123

86124
## 1.22.0 - 2022-02-18
87125

docs/references/function-list-by-category.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -188,25 +188,25 @@ YIELDMAT | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Secur
188188
Excel Function | PhpSpreadsheet Function
189189
-------------------------|--------------------------------------
190190
CELL | **Not yet Implemented**
191-
ERROR.TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::errorType
191+
ERROR.TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError::type
192192
INFO | **Not yet Implemented**
193-
ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isBlank
194-
ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isErr
195-
ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isError
196-
ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isEven
197-
ISFORMULA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isFormula
198-
ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isLogical
199-
ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNa
200-
ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNonText
201-
ISNUMBER | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNumber
202-
ISODD | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isOdd
203-
ISREF | **Not yet Implemented**
204-
ISTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isText
205-
N | \PhpOffice\PhpSpreadsheet\Calculation\Functions::n
206-
NA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::NA
193+
ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isBlank
194+
ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue::isErr
195+
ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue::isError
196+
ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isEven
197+
ISFORMULA | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isFormula
198+
ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isLogical
199+
ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue::isNa
200+
ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isNonText
201+
ISNUMBER | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isNumber
202+
ISODD | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isOdd
203+
ISREF | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isRef
204+
ISTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isText
205+
N | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::asNumber
206+
NA | \PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError::NA
207207
SHEET | **Not yet Implemented**
208208
SHEETS | **Not yet Implemented**
209-
TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE
209+
TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::type
210210

211211
## CATEGORY_LOGICAL
212212

@@ -233,7 +233,7 @@ AREAS | **Not yet Implemented**
233233
CHOOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Selection::CHOOSE
234234
COLUMN | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation::COLUMN
235235
COLUMNS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation::COLUMNS
236-
FILTER | **Not yet Implemented**
236+
FILTER | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Filter::filter
237237
FORMULATEXT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Formula::text
238238
GETPIVOTDATA | **Not yet Implemented**
239239
HLOOKUP | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\HLookup::lookup
@@ -246,10 +246,10 @@ OFFSET | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Offse
246246
ROW | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation::ROW
247247
ROWS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation::ROWS
248248
RTD | **Not yet Implemented**
249-
SORT | **Not yet Implemented**
250-
SORTBY | **Not yet Implemented**
249+
SORT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Sort::sort
250+
SORTBY | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Sort::sortBy
251251
TRANSPOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Matrix::transpose
252-
UNIQUE | **Not yet Implemented**
252+
UNIQUE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Unique::unique
253253
VLOOKUP | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\VLookup::lookup
254254
XLOOKUP | **Not yet Implemented**
255255
XMATCH | **Not yet Implemented**
@@ -274,6 +274,8 @@ BASE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Base::
274274
CEILING | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling::ceiling
275275
CEILING.MATH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling::math
276276
CEILING.PRECISE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling::precise
277+
CHOOSECOLS | **Not yet Implemented**
278+
CHOOSEROWS | **Not yet Implemented**
277279
COMBIN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations::withoutRepetition
278280
COMBINA | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations::withRepetition
279281
COS | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cosine::cos
@@ -284,15 +286,18 @@ CSC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\C
284286
CSCH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cosecant::csch
285287
DECIMAL | **Not yet Implemented**
286288
DEGREES | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Angle::toDegrees
289+
DROP | **Not yet Implemented**
287290
ECMA.CEILING | **Not yet Implemented**
288291
EVEN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round::even
289292
EXP | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Exp::evaluate
293+
EXPAND | **Not yet Implemented**
290294
FACT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Factorial::fact
291295
FACTDOUBLE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Factorial::factDouble
292296
FLOOR | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor::floor
293297
FLOOR.MATH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor::math
294298
FLOOR.PRECISE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor::precise
295299
GCD | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Gcd::evaluate
300+
HSTACK | **Not yet Implemented**
296301
INT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\IntClass::evaluate
297302
ISO.CEILING | **Not yet Implemented**
298303
LCM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Lcm::evaluate
@@ -339,9 +344,15 @@ SUMSQ | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSqu
339344
SUMX2MY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares::sumXSquaredMinusYSquared
340345
SUMX2PY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares::sumXSquaredPlusYSquared
341346
SUMXMY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares::sumXMinusYSquared
347+
TAKE | **Not yet Implemented**
342348
TAN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Tangent::tan
343349
TANH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Tangent::tanh
350+
TOCOL | **Not yet Implemented**
351+
TOROW | **Not yet Implemented**
344352
TRUNC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trunc::evaluate
353+
VSTACK | **Not yet Implemented**
354+
WRAPCOLS | **Not yet Implemented**
355+
WRAPROWS | **Not yet Implemented**
345356

346357
## CATEGORY_STATISTICAL
347358

@@ -539,7 +550,10 @@ SEARCHB | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Search
539550
SUBSTITUTE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace::substitute
540551
T | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::test
541552
TEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::TEXTFORMAT
553+
TEXTAFTER | **Not yet Implemented**
554+
TEXTBEFORE | **Not yet Implemented**
542555
TEXTJOIN | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::TEXTJOIN
556+
TEXTSPLIT | **Not yet Implemented**
543557
THAIDIGIT | **Not yet Implemented**
544558
THAINUMSOUND | **Not yet Implemented**
545559
THAINUMSTRING | **Not yet Implemented**

0 commit comments

Comments
 (0)