Skip to content

Commit 17e894e

Browse files
authored
Merge branch 'master' into issue4125
2 parents 5e248cf + f7c183b commit 17e894e

File tree

134 files changed

+3673
-325
lines changed

Some content is hidden

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

134 files changed

+3673
-325
lines changed

.php-cs-fixer.dist.php

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$config
1111
->setRiskyAllowed(true)
1212
->setFinder($finder)
13-
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
13+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect(null, 600))
1414
->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer' . preg_replace('~\W~', '-', __DIR__))
1515
->setRules([
1616
'align_multiline_comment' => true,
@@ -19,18 +19,17 @@
1919
'backtick_to_shell_exec' => true,
2020
'binary_operator_spaces' => true,
2121
'blank_line_after_namespace' => true,
22+
'blank_lines_before_namespace' => ['max_line_breaks' => 2, 'min_line_breaks' => 2], // we want 1 blank line before namespace
2223
'blank_line_after_opening_tag' => true,
2324
'blank_line_before_statement' => true,
24-
'braces' => true,
2525
'cast_spaces' => true,
2626
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // const are often grouped with other related const
2727
'class_definition' => false, // phpcs disagree
28-
'class_keyword_remove' => false, // Deprecated, and ::class keyword gives us better support in IDE
2928
'combine_consecutive_issets' => true,
3029
'combine_consecutive_unsets' => true,
3130
'combine_nested_dirname' => true,
3231
'comment_to_phpdoc' => false, // interferes with annotations
33-
'compact_nullable_typehint' => true,
32+
'compact_nullable_type_declaration' => true,
3433
'concat_space' => ['spacing' => 'one'],
3534
'constant_case' => true,
3635
'date_time_immutable' => false, // Break our unit tests
@@ -47,7 +46,6 @@
4746
'encoding' => true,
4847
'ereg_to_preg' => true,
4948
'error_suppression' => false, // it breaks \PhpOffice\PhpSpreadsheet\Helper\Handler
50-
'escape_implicit_backslashes' => true,
5149
'explicit_indirect_variable' => false, // I feel it makes the code actually harder to read
5250
'explicit_string_variable' => false, // I feel it makes the code actually harder to read
5351
'final_class' => false, // We need non-final classes
@@ -59,7 +57,6 @@
5957
'fully_qualified_strict_types' => true,
6058
'function_declaration' => true,
6159
'function_to_constant' => true,
62-
'function_typehint_space' => true,
6360
'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright']],
6461
'general_phpdoc_tag_rename' => true,
6562
'global_namespace_import' => true,
@@ -93,15 +90,13 @@
9390
'native_constant_invocation' => false, // Micro optimization that look messy
9491
'native_function_casing' => true,
9592
'native_function_invocation' => false, // I suppose this would be best, but I am still unconvinced about the visual aspect of it
96-
'native_function_type_declaration_casing' => true,
97-
'new_with_braces' => true,
93+
'new_with_parentheses' => ['anonymous_class' => true, 'named_class' => true],
9894
'no_alias_functions' => true,
9995
'no_alias_language_construct_call' => true,
10096
'no_alternative_syntax' => true,
10197
'no_binary_string' => true,
10298
'no_blank_lines_after_class_opening' => true,
10399
'no_blank_lines_after_phpdoc' => true,
104-
'no_blank_lines_before_namespace' => false, // we want 1 blank line before namespace
105100
'no_break_comment' => true,
106101
'no_closing_tag' => true,
107102
'no_empty_comment' => true,
@@ -121,16 +116,14 @@
121116
'no_space_around_double_colon' => true,
122117
'no_spaces_after_function_name' => true,
123118
'no_spaces_around_offset' => true,
124-
'no_spaces_inside_parenthesis' => true,
125119
'no_superfluous_elseif' => false, // Might be risky on a huge code base
126120
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
127-
'no_trailing_comma_in_list_call' => true,
128-
'no_trailing_comma_in_singleline_array' => true,
121+
'no_trailing_comma_in_singleline' => ['elements' => ['arguments', 'array_destructuring', 'array', 'group_import']],
129122
'no_trailing_whitespace' => true,
130123
'no_trailing_whitespace_in_comment' => true,
131124
'no_trailing_whitespace_in_string' => false, // Too dangerous
132125
'no_unneeded_control_parentheses' => true,
133-
'no_unneeded_curly_braces' => true,
126+
'no_unneeded_braces' => true,
134127
'no_unneeded_final_method' => true,
135128
'no_unreachable_default_argument_value' => true,
136129
'no_unset_cast' => true,
@@ -175,7 +168,6 @@
175168
'phpdoc_align' => false, // Waste of time
176169
'phpdoc_annotation_without_dot' => true,
177170
'phpdoc_indent' => true,
178-
//'phpdoc_inline_tag' => true,
179171
'phpdoc_line_span' => false, // Unfortunately our old comments turn even uglier with this
180172
'phpdoc_no_access' => true,
181173
'phpdoc_no_alias_tag' => true,
@@ -215,20 +207,20 @@
215207
'simplified_if_return' => false, // Even if technically correct we prefer to be explicit
216208
'simplified_null_return' => false, // Even if technically correct we prefer to be explicit
217209
'single_blank_line_at_eof' => true,
218-
'single_blank_line_before_namespace' => true,
219210
'single_class_element_per_statement' => true,
220211
'single_import_per_statement' => true,
221212
'single_line_after_imports' => true,
222213
'single_line_comment_style' => true,
223214
'single_line_throw' => false, // I don't see any reason for having a special case for Exception
224215
'single_quote' => true,
225-
'single_space_after_construct' => true,
226216
'single_trait_insert_per_statement' => true,
227217
'space_after_semicolon' => true,
218+
'spaces_inside_parentheses' => ['space' => 'none'],
228219
'standardize_increment' => true,
229220
'standardize_not_equals' => true,
230221
'static_lambda' => false, // Risky if we can't guarantee nobody use `bindTo()`
231222
'strict_comparison' => false, // No, too dangerous to change that
223+
'string_implicit_backslashes' => false, // was escape_implicit_backslashes, too confusing
232224
'strict_param' => false, // No, too dangerous to change that
233225
'string_length_to_empty' => true,
234226
'string_line_ending' => true,
@@ -240,6 +232,7 @@
240232
'ternary_to_null_coalescing' => true,
241233
'trailing_comma_in_multiline' => true,
242234
'trim_array_spaces' => true,
235+
'type_declaration_spaces' => ['elements' => ['function', 'property']], // was function_typehint_space
243236
'types_spaces' => true,
244237
'unary_operator_spaces' => true,
245238
'use_arrow_functions' => true,

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org).
77

88
## TBD - 3.0.0
99

10+
### Dynamic Arrays
11+
12+
- Support for Excel dynamic arrays is added. It is an opt-in feature, so our hope is that there will be no BC breaks, but it is a very large change. Full support is added for Xlsx. It is emulated as Ctrl-Shift-Enter arrays for Ods read and write and Excel2003 and Gnumeric read. Html/Pdf and Csv writers will populate cells on output if they are the result of array formulas. No support is added for Xls or Slk.
13+
14+
### Added
15+
16+
- Excel Dynamic Arrays. [Issue #3901](https://github.com/PHPOffice/PhpSpreadsheet/issues/3901) [Issue #3659](https://github.com/PHPOffice/PhpSpreadsheet/issues/3659) [Issue #1834](https://github.com/PHPOffice/PhpSpreadsheet/issues/1834) [PR #3962](https://github.com/PHPOffice/PhpSpreadsheet/pull/3962)
17+
18+
### Changed
19+
20+
- Nothing yet.
21+
22+
### Deprecated
23+
24+
- Nothing yet.
25+
26+
### Moved
27+
28+
- Nothing yet.
29+
30+
### Fixed
31+
32+
- Nothing yet.
33+
34+
## 2024-08-07 - 2.2.2
35+
1036
### Added
1137

1238
- Nothing yet.
@@ -27,6 +53,9 @@ and this project adheres to [Semantic Versioning](https://semver.org).
2753

2854
- Html Reader Preserve Unicode Whitespace. [Issue #1284](https://github.com/PHPOffice/PhpSpreadsheet/issues/1284) [PR #4106](https://github.com/PHPOffice/PhpSpreadsheet/pull/4106)
2955
- RATE Function Floating Point Number of Periods. [PR #4107](https://github.com/PHPOffice/PhpSpreadsheet/pull/4107)
56+
- Parameter Name Change Xlsx Writer Workbook. [Issue #4108](https://github.com/PHPOffice/PhpSpreadsheet/issues/4108) [PR #4111](https://github.com/PHPOffice/PhpSpreadsheet/pull/4111)
57+
- New Algorithm for TRUNC, ROUNDUP, ROUNDDOWN. [Issue #4113](https://github.com/PHPOffice/PhpSpreadsheet/issues/4113) [PR #4115](https://github.com/PHPOffice/PhpSpreadsheet/pull/4115)
58+
- Worksheet applyStylesFromArray Retain Active Cell (Excel 16 was having a problem with some files). [Issue #4128](https://github.com/PHPOffice/PhpSpreadsheet/issues/4128) [PR #4132](https://github.com/PHPOffice/PhpSpreadsheet/pull/4132)
3059

3160
## 2024-07-29 - 2.2.1
3261

composer.lock

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

docs/references/features-cross-reference.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,15 @@
365365
<td style="text-align: center; color: red;">✖</td>
366366
</tr>
367367
<tr>
368-
<td style="padding-left: 1em;">Array</td>
369-
<td style="text-align: center; color: red;">✖</td>
370-
<td style="text-align: center; color: red;">✖</td>
371-
<td style="text-align: center; color: red;">✖</td>
372-
<td style="text-align: center; color: red;">✖</td>
373-
<td style="text-align: center; color: red;">✖</td>
374-
<td style="text-align: center; color: red;">✖</td>
368+
<td style="padding-left: 1em;">Array Formula</td>
375369
<td style="text-align: center; color: red;">✖</td>
370+
<td style="text-align: center; color: green;">✔</td>
371+
<td style="text-align: center; color: green;">✔</td>
372+
<td style="text-align: center; color: green;">✔</td>
373+
<td style="text-align: center; color: green;">✔</td>
374+
<td style="text-align: center;">N/A</td>
376375
<td style="text-align: center; color: red;">✖</td>
376+
<td style="text-align: center;">N/A</td>
377377
</tr>
378378
<tr>
379379
<td style="padding-left: 1em;">Rich Text</td>
@@ -1005,6 +1005,7 @@
10051005
5. <span id="footnote5">Xlsx macros can be read and written; their values can be retrieved and changed, but only in a binary form which is unlikely to be useful</span>
10061006
6. <span id="footnote6">There is very limited support for reading styles from an Ods spreadsheet. Writing styles has better support, although Number Format is incomplete.</span>
10071007
7. <span id="footnote7">In most cases, Html reader processes only inline styles; styles provided by Css classes may be ignored.</span>
1008+
8. <span id="footnote8">Code must [opt in](../topics/recipes.md#array-formulas) to array output.</span>
10081009

10091010
## Writers
10101011

@@ -1175,6 +1176,15 @@
11751176
<td style="text-align: center; color: red;">✖</td>
11761177
<td style="text-align: center; color: red;">✖</td>
11771178
</tr>
1179+
<tr>
1180+
<td style="padding-left: 0.5em;"><strong>Array Formula<a href="#footnote8"><sup>8</sup></a></strong></td>
1181+
<td style="text-align: center; color: red;">✖</td>
1182+
<td style="text-align: center; color: green;">✔</td>
1183+
<td style="text-align: center; color: green;">✔</td>
1184+
<td style="text-align: center; color: green;">✔</td>
1185+
<td style="text-align: center; color: green;">✔</td>
1186+
<td style="text-align: center; color: green;">✔</td>
1187+
</tr>
11781188
<tr>
11791189
<td style="padding-left: 0.5em;"><strong>Rows and Column Properties</strong></td>
11801190
<td></td>

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ CHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Charac
529529
CLEAN | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim::nonPrintable
530530
CODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert::code
531531
CONCAT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::CONCATENATE
532-
CONCATENATE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::CONCATENATE
532+
CONCATENATE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::actualCONCATENATE
533533
DBCS | **Not yet Implemented**
534534
DOLLAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::DOLLAR
535535
EXACT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::exact
@@ -586,5 +586,10 @@ WEBSERVICE | \PhpOffice\PhpSpreadsheet\Calculation\Web\Service::we
586586

587587
Excel Function | PhpSpreadsheet Function
588588
-------------------------|--------------------------------------
589-
ANCHORARRAY | **Not yet Implemented**
590-
SINGLE | **Not yet Implemented**
589+
590+
## CATEGORY_MICROSOFT_INTERNAL
591+
592+
Excel Function | PhpSpreadsheet Function
593+
-------------------------|--------------------------------------
594+
ANCHORARRAY | \PhpOffice\PhpSpreadsheet\Calculation\Internal\ExcelArrayPseudoFunctions::anchorArray
595+
SINGLE | \PhpOffice\PhpSpreadsheet\Calculation\Internal\ExcelArrayPseudoFunctions::single

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpread
1515
AGGREGATE | CATEGORY_MATH_AND_TRIG | **Not yet Implemented**
1616
AMORDEGRC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization::AMORDEGRC
1717
AMORLINC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization::AMORLINC
18-
ANCHORARRAY | CATEGORY_UNCATEGORISED | **Not yet Implemented**
18+
ANCHORARRAY | CATEGORY_MICROSOFT_INTERNAL | \PhpOffice\PhpSpreadsheet\Calculation\Internal\ExcelArrayPseudoFunctions::anchorArray
1919
AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations::logicalAnd
2020
ARABIC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Arabic::evaluate
2121
AREAS | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemented**
@@ -89,7 +89,7 @@ COMBIN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpread
8989
COMBINA | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations::withRepetition
9090
COMPLEX | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex::COMPLEX
9191
CONCAT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::CONCATENATE
92-
CONCATENATE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::CONCATENATE
92+
CONCATENATE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::actualCONCATENATE
9393
CONFIDENCE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Confidence::CONFIDENCE
9494
CONFIDENCE.NORM | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Confidence::CONFIDENCE
9595
CONFIDENCE.T | CATEGORY_STATISTICAL | **Not yet Implemented**
@@ -510,7 +510,7 @@ SHEET | CATEGORY_INFORMATION | **Not yet Implemente
510510
SHEETS | CATEGORY_INFORMATION | **Not yet Implemented**
511511
SIGN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sign::evaluate
512512
SIN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine::sin
513-
SINGLE | CATEGORY_UNCATEGORISED | **Not yet Implemented**
513+
SINGLE | CATEGORY_MICROSOFT_INTERNAL | \PhpOffice\PhpSpreadsheet\Calculation\Internal\ExcelArrayPseudoFunctions::single
514514
SINH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine::sinh
515515
SKEW | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations::skew
516516
SKEW.P | CATEGORY_STATISTICAL | **Not yet Implemented**

0 commit comments

Comments
 (0)