Skip to content

Commit 576ce50

Browse files
authored
Merge branch 'master' into issue56
2 parents 92d3c1b + f9b1b76 commit 576ce50

File tree

256 files changed

+2587
-901
lines changed

Some content is hidden

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

256 files changed

+2587
-901
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787

8888
# This is non-ideal because it only checks for the last commit of the PR, not all of them, but better than nothing
8989
- name: Check PHPDoc types
90-
run: ./bin/check-phpdoc-types
90+
run: ./bin/check-phpdoc-types.php
9191

9292
php-cs-fixer:
9393
runs-on: ubuntu-latest

.php-cs-fixer.dist.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22

33
$finder = PhpCsFixer\Finder::create()
4-
->exclude('vendor')
4+
->exclude(['vendor', 'docs', '.git', '.github'])
55
->notPath('src/PhpSpreadsheet/Writer/ZipStream3.php')
6-
->name('/(\.php|^generate-document|^generate-locales|^check-phpdoc-types)$/')
76
->in(__DIR__);
87

98
$config = new PhpCsFixer\Config();

.phpcs.xml.dist

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
<file>src</file>
77
<file>tests</file>
88
<file>infra</file>
9-
<file>bin/generate-document</file>
10-
<file>bin/generate-locales</file>
11-
<file>bin/check-phpdoc-types</file>
12-
13-
<exclude-pattern>samples/Header.php</exclude-pattern>
14-
<exclude-pattern>*/tests/Core/*/*Test\.(inc|css|js)$</exclude-pattern>
9+
<file>bin</file>
1510

1611
<arg name="report-width" value="200"/>
1712
<arg name="parallel" value="80"/>

CHANGELOG.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com)
66
and this project adheres to [Semantic Versioning](https://semver.org).
77

8-
## TBD - 4.2.0
8+
## TBD - 4.3.0
99

1010
### Added
1111

12-
- Add ability to add custom functions to Calculation. [PR #4390](https://github.com/PHPOffice/PhpSpreadsheet/pull/4390)
13-
- Add FormulaRange to IgnoredErrors. [PR #4393](https://github.com/PHPOffice/PhpSpreadsheet/pull/4393)
14-
- TextGrid improvements. [PR #4418](https://github.com/PHPOffice/PhpSpreadsheet/pull/4418)
15-
- Permit read to class which extends Spreadsheet. [Discussion #4402](https://github.com/PHPOffice/PhpSpreadsheet/discussions/4402) [PR #4404](https://github.com/PHPOffice/PhpSpreadsheet/pull/4404)
16-
- Conditional and table formatting support for html writer [PR #4412](https://github.com/PHPOffice/PhpSpreadsheet/pull/4412)
12+
- Xml Reader recognize indents. [Issue #4448](https://github.com/PHPOffice/PhpSpreadsheet/issues/4448) [PR #4449](https://github.com/PHPOffice/PhpSpreadsheet/pull/4449)
1713

1814
### Removed
1915

2016
- Nothing yet.
2117

2218
### Changed
2319

24-
- Phpstan Version 2. [PR #4384](https://github.com/PHPOffice/PhpSpreadsheet/pull/4384)
25-
- Start migration to Phpstan level 9. [PR #4396](https://github.com/PHPOffice/PhpSpreadsheet/pull/4396)
26-
- Calculation locale logic moved to separate class. [PR #4398](https://github.com/PHPOffice/PhpSpreadsheet/pull/4398)
27-
- TREND_POLYNOMIAL_* and TREND_BEST_FIT do not work, and are changed to throw Exceptions if attempted. (TREND_BEST_FIT_NO_POLY works.) An attempt to use an unknown trend type will now also throw an exception. [Issue #4400](https://github.com/PHPOffice/PhpSpreadsheet/issues/4400) [PR #4339](https://github.com/PHPOffice/PhpSpreadsheet/pull/4339)
28-
- Month parameter of DATE function will now return VALUE if an ordinal string (e.g. '3rd') is used, but will accept bool or null. [PR #4420](https://github.com/PHPOffice/PhpSpreadsheet/pull/4420)
20+
- Nothing yet.
2921

3022
### Moved
3123

@@ -37,6 +29,29 @@ and this project adheres to [Semantic Versioning](https://semver.org).
3729

3830
### Fixed
3931

32+
- Micro-optimization for excelToDateTimeObject. [Issue #4438](https://github.com/PHPOffice/PhpSpreadsheet/issues/4438) [PR #4442](https://github.com/PHPOffice/PhpSpreadsheet/pull/4442)
33+
- Print Area and Row Break. [Issue #1275](https://github.com/PHPOffice/PhpSpreadsheet/issues/1275) [PR #4450](https://github.com/PHPOffice/PhpSpreadsheet/pull/4450)
34+
35+
## 2025-04-16 - 4.2.0
36+
37+
### Added
38+
39+
- Add ability to add custom functions to Calculation. [PR #4390](https://github.com/PHPOffice/PhpSpreadsheet/pull/4390)
40+
- Add FormulaRange to IgnoredErrors. [PR #4393](https://github.com/PHPOffice/PhpSpreadsheet/pull/4393)
41+
- TextGrid improvements. [PR #4418](https://github.com/PHPOffice/PhpSpreadsheet/pull/4418)
42+
- Permit read to class which extends Spreadsheet. [Discussion #4402](https://github.com/PHPOffice/PhpSpreadsheet/discussions/4402) [PR #4404](https://github.com/PHPOffice/PhpSpreadsheet/pull/4404)
43+
- Conditional and table formatting support for html writer [PR #4412](https://github.com/PHPOffice/PhpSpreadsheet/pull/4412)
44+
45+
### Changed
46+
47+
- Phpstan Version 2. [PR #4384](https://github.com/PHPOffice/PhpSpreadsheet/pull/4384)
48+
- Start migration to Phpstan level 9. [PR #4396](https://github.com/PHPOffice/PhpSpreadsheet/pull/4396)
49+
- Calculation locale logic moved to separate class. [PR #4398](https://github.com/PHPOffice/PhpSpreadsheet/pull/4398)
50+
- TREND_POLYNOMIAL_* and TREND_BEST_FIT do not work, and are changed to throw Exceptions if attempted. (TREND_BEST_FIT_NO_POLY works.) An attempt to use an unknown trend type will now also throw an exception. [Issue #4400](https://github.com/PHPOffice/PhpSpreadsheet/issues/4400) [PR #4339](https://github.com/PHPOffice/PhpSpreadsheet/pull/4339)
51+
- Month parameter of DATE function will now return VALUE if an ordinal string (e.g. '3rd') is used, but will accept bool or null. [PR #4420](https://github.com/PHPOffice/PhpSpreadsheet/pull/4420)
52+
53+
### Fixed
54+
4055
- Ignore fractional part of Drawing Shadow Alpha. [Issue #4415](https://github.com/PHPOffice/PhpSpreadsheet/issues/4415) [PR #4417](https://github.com/PHPOffice/PhpSpreadsheet/pull/4417)
4156
- BIN2DEC, OCT2DEC, and HEX2DEC return numbers rather than strings. [Issue #4383](https://github.com/PHPOffice/PhpSpreadsheet/issues/4383) [PR #4389](https://github.com/PHPOffice/PhpSpreadsheet/pull/4389)
4257
- Fix TREND_BEST_FIT_NO_POLY. [Issue #4400](https://github.com/PHPOffice/PhpSpreadsheet/issues/4400) [PR #4339](https://github.com/PHPOffice/PhpSpreadsheet/pull/4339)

bin/check-phpdoc-types renamed to bin/check-phpdoc-types.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* This will help us slowly migrate away from PHPDoc typing to PHP native typing.
1010
*/
11-
function checkPhpDocTypes(): void
11+
function checkPhpDocTypes(): int
1212
{
1313
$content = shell_exec('git diff --cached') ?? shell_exec('git diff') ?? shell_exec('git show HEAD');
1414
preg_match_all('~^\+ +\* @(param|var) (mixed|string|int|float|bool|null|array|\?|\|)+( \$\w+)?$~m', "$content", $parameters);
@@ -19,11 +19,16 @@ function checkPhpDocTypes(): void
1919
...$returns[0],
2020
];
2121

22-
if ($errors) {
22+
if (!empty($errors)) {
2323
echo 'PHP native types must be used instead of PHPDoc types (without comments), for the following lines:' . PHP_EOL . PHP_EOL;
2424
echo implode(PHP_EOL, $errors) . PHP_EOL;
25-
exit(1);
25+
26+
return 1;
2627
}
28+
29+
return 0;
2730
}
2831

29-
checkPhpDocTypes();
32+
if (checkPhpDocTypes()) {
33+
exit(1);
34+
}

bin/generate-document renamed to bin/generate-document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
55
use PhpOffice\PhpSpreadsheetInfra\DocumentGenerator;
66

7-
require_once 'vendor/autoload.php';
7+
require_once __DIR__ . '/..' . '/vendor/autoload.php';
88

99
$phpSpreadsheetFunctions = Calculation::getFunctions();
1010
ksort($phpSpreadsheetFunctions);

bin/generate-locales renamed to bin/generate-locales.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
55
use PhpOffice\PhpSpreadsheetInfra\LocaleGenerator;
66

7-
require_once 'vendor/autoload.php';
7+
require_once __DIR__ . '/..' . '/vendor/autoload.php';
88

99
$phpSpreadsheetFunctions = Calculation::getFunctions();
1010

bin/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if [ "$files" != "" ]; then
2424
fi
2525

2626
# Check PHPDoc types
27-
./bin/check-phpdoc-types
27+
./bin/check-phpdoc-types.php
2828
if [ $? -ne 0 ]; then
2929
pass=false
3030
fi

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
],
4747
"scripts": {
4848
"check": [
49-
"php ./bin/check-phpdoc-types",
49+
"php bin/check-phpdoc-types.php",
5050
"phpcs samples/ src/ tests/ --report=checkstyle",
5151
"phpcs samples/ src/ tests/ --standard=PHPCompatibility --runtime-set testVersion 8.0- --exclude=PHPCompatibility.Variables.ForbiddenThisUseContexts -n",
5252
"php-cs-fixer fix --ansi --dry-run --diff",

composer.lock

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

0 commit comments

Comments
 (0)