Commit Graph

121 Commits

Author SHA1 Message Date
Adrien Crivelli f62245bbae phpcs on samples/ too 2023-12-09 16:56:55 +01:00
Adrien Crivelli 7079e58054 Declare our minimum PHP version
So that composer will not update our dependencies to something that
would not work with PHP 8.0. And so that PHPStan analyzes assuming we
are running 8.0
2023-09-21 11:14:47 +08:00
dmytromikhieiev1985 4e54ed389b Replace ezyang/htmlpurifier with voku/anti-xss (#3724)
* Replace ezyang/htmlpurifier with voku/anti-xss

* Update XssVulnerabilityTest
2023-09-13 00:29:01 -07:00
Adrien Crivelli bb6ae9ce7d Prevent adding PHPDoc types instead of native types
PHPDoc types can sometimes be entirely expressed as PHP native types. It
is better because it avoids code duplication and enables type runtime
check.

This will help us slowly migrate away from PHPDoc typing to PHP native typing.
2023-09-13 10:06:58 +08:00
Adrien Crivelli f131ca30e6 Drop PHP 7.4 support
This is according to our formal, published, policy to only support
EOL PHP after 6 months.

See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support

Also share the exact same dev deps across all PHP version for GitHub
Actions so runs are faster, much most importantly they are stable and
predictable. And we decide manually when we want to migrate to PHPUnit
10.

Fixes #3634
Closes #3710
2023-09-06 22:51:47 +08:00
oleibman 3aab263580 Upgrade mitoteam/jpgraph (#3603)
They have made some changes at my request, the major effect of which is that it will now work with 33_Chart_create_bar_stacked. This is a departure for them in that they have changed the functionality of jpgraph, not merely made sure that it is compatible with new Php releases.
2023-06-01 22:17:30 -07:00
oleibman dbba802555 WIP Contingency for Zipstream 3.0 (#3410)
Zipstream's newest production release requires Php8.1. This is not necessarily a problem for us as we are locked to an earlier release. However, psr/simple-cache became a real mess for us as people wanted to install PhpSpreadsheet alongside other products which required a version of simple-cache that could not run in some of the versions of Php which we support, and I would like to avoid having to go through that again. This ticket is a contingency to put us ahead of the curve in case such a problem should arise with Zipstream. There is reason to believe that Zipstream is not so widely used as simple-cache, so we do not need to rush this change in. However, should that belief prove incorrect, the change should be ready to go when needed.
2023-05-23 07:35:03 -07:00
oleibman c8743061a3 PhpUnit 10 Compatibility Part 3 (Last) (#3530)
* PhpUnit 10 Compatibility Part 3 (Last)

Final changes for PhpUnit 10, including enabling it for testing. This finishes the work of PR #3523 and PR #3526.

The major remaining problem with PhpUnit 10 is that earlier releases converted notices and warnings to exceptions, and 10 does not. Not having the information provided by the messages seems risky to me. Fortunately, it appears that you can add an error handler to the test bootstrap for 10 and make it act like earlier versions; I have done so. In order to demonstrate the effectiveness of this handler, a new otherwise unused class Helper/Handler and tests for that class are added.

As part of the testing of this change, it became apparent that the fopen in OLE::getStream attempts to create a dynamic property $context in Shared/OLE/ChainedBlockStream, and that action is deprecated in Php8.2. Adding the property to the class eliminates that problem. No executable code is added, and this is the only change to source code.

There also seems to have been a change in assertXmlStringEqualsXmlString in PhpUnit 10. The only test which uses that method is Chart/Issue589Test, and both the places which use that method could just as easily and effectively use assertSame. They are changed to do so.

* Remove Phpunit Verbose Option

Not supported in PhpUnit 10. I'm not at all sure that this is the correct solution for this problem.

* Try Changing Phpunit Command for Different Php Releases

Not sure how to test this locally. We'll see if it works on github.

* Another main.yml attempt

We shall see.

* Eliminate One Test

Not sure why testDeprecated is not working in Github; it works locally. Disable it for now and continue to research.

* Show Incomplete and Other Messages in PhpUnit 10

6 new command line args to replace the 1 they got rid of.

* Restore Disabled Test

Deprecated messages are suppressed by default setting for error_reporting. Switch that to E_ALL in bootstrap and restore original test.

* Add Deprecation Tests for PhpUnit 9-

Default configuration option caused deprecation messages to be suppressed. Change the option.
2023-04-27 20:20:25 -07:00
MarkBaker d73d063556 Update contributor notes and related composer scripts 2023-03-09 17:38:20 +01:00
MarkBaker 247f9cb7f9 DealerDirect have renamed the branch for phpcodesniffer-composer-installer from master to main 2023-02-05 13:24:43 +01:00
MarkBaker 36c25b4427 Drop support for PHP 7.3 2022-11-09 22:55:31 +01:00
oleibman a193f36f31 More Carets in composer.json (#3090)
* More Carets in composer.json

Following up on PR #3086, there are 3 additional items in the require-dev section that should have carets. I probably accidentally removed them for tcpdf and mitoteam, which point to the current release anyhow. Dependabot appears to be responsible for mpdf, which is not pointing to the current release, but I have tested with current successfully.

* Minor Fix for Change Made Earlier Today

"Scrutinizer Tweak" causes a Phpstan error. Fix baseline to correct it.
2022-09-27 22:13:19 -07:00
BrokenSourceCode 46beabbefe Fix ezyang/htmlpurifier caret version range 2022-09-25 14:37:47 +02:00
oleibman a3921d20bc Upgrade ezyang/htmlpurifier for Php8.2 (#3073)
They have just issued a new release. Using that should eliminate the last of our Php8.2 unit test problems, so we will be able to change that to non-experimental when it is convenient for us.
2022-09-19 06:20:48 -07:00
oleibman c465b1c283 Minor Changes for Cygwin (#3070)
No source code changes. Mitoteam added a change to better accomodate Cygwin; pick up their new release. While testing, discovered one test that was already skipped on Windows and needs to be skipped on Cygwin as well.
2022-09-17 07:32:12 -07:00
oleibman 8513c6418c Memory Leak in Sample35 (#3062)
* Memory Leak in Sample35

All but 6 chart samples can be rendered by Sample35. Of those 6, 3 of the problems are because the script runs out of memory processing them. Adopting a suggestion from @MAKS-dev in issue #2092, adding a call to gc_collect_cycles after the charts from each spreadsheet is rendered appears to make it possible to include those 3 spreadsheets in Sample35 after all.

Also take advantage of this opportunity to correct a number (hopefully all) of Scrutinizer problems with JpgraphRendererBases.

* Minor Fix

Problem running 8.1 unit tests.

* Resolve Problems with Pie 3D Charts

Minor fix, leaving only one spreadsheet unusable in Sample35. The reasons for its unusability are now documented in the code.

* Mitoteam Made Changes

Discussing this problem with them, they decided they should make a change for Pie3D rather than forcing us to use the workaround pushed earlier. Change to require mitoteam 10.2.3, revert workaround.
2022-09-14 10:12:53 -07:00
oleibman 2fe66d097f Upgrade mitoteam/jpgraph for Php8.2 Usage (#3058)
They just released a Php8.2-compatible version. We should use that version going forward. Some tests had been disabled in 8.2 due to the problems which the new release fixes; these are now restored.
2022-09-12 08:23:43 -07:00
MarkBaker e67de6f300 Support for SimpleCache Interface versions 1.0, 2.0 and 3.0; to stop people moaning; even though it requires a second implementation of the Memory cache for Cells 2022-08-20 21:27:05 +02:00
oleibman bb072d1ca7 Upgrade Dev TCPDF to 6.5 (#3006)
* Upgrade Dev TCPDF to 6.5

Implementation of https://github.com/tecnickcom/TCPDF/pull/467, which is available in just-released Tcpdf 6.5, will improve look of Tcpdf rendering for PhpSpreadsheet. Fix #1164.

One test had been suppressed for Tcpdf, ostensibly because it was not compatible with Php8. As it turns out, the PhpSpreadsheet code which invokes Tcpdf was (harmlessly) incorrect, so the Php8 issue was actually with PhpSpreadsheet, not Tcpdf. That code is corrected, and the test is no longer suppressed.

* Update Change Log

Pick up some earlier changes as well as this one, and deprecations which had been omitted from the 1.24 change log.
2022-08-14 10:57:34 -07:00
oleibman 5c13b179a1 Replace Dev jpgraph/jpgraph with mitoteam/jpgraph (#2997)
* Replace Dev jpgraph/jpgraph with mitoteam/jpgraph

PR #2979 added support for mitoteam/jpgraph as an alternative to jpgraph/jpgraph. The package jpgraph/jpgraph is abandoned in composer, and the version loaded with composer has been unusable for some time. This PR removes the dev requirement for jpgraph/jpgraph, and adds a dev requirement for mitoteam/jpgraph in its place.

With a usable graph library, a number of tests and samples that had been disabled are now re-enabled. A lot of new functionality has been added to Charts recently. Some of that new code has exposed bugs in JpgraphRendererBase. I have fixed those where I could. A handful of exceptions remain; I will investigate, and hopefully fix, those over time, but I don't feel it is necessary to fix them all before installing this PR - we are already way ahead of the game with the graphs that are working.

Three members had been ignoring code coverage in whole or in part because of the unavailability of a usable graph libray. Code coverage is restored in them. I am relieved to report that, although they aren't completely covered, adding them did not reduce code coverage by much - it is still over 90.4%.

I took a look at JpgraphRendererBase and Phpstan. Phpstan reports 128 problems. When I added some docblocks to correct some of those, the number increased to 284. Sigh. I will investigate over time, but, for now, we will still suppress Phpstan for JpgraphRendererBase.

I do not find a License file for mitoteam. However, there also wasn't one for jpgraph in the first place. Based on that and the discussion in #2996 (mitoteam will be used in exactly the same manner as mpdf), I don't think this is a problem. IANAL.

* PHP 8.2 Problems

Tons of "cannot create dynamic property" deprecations in jpgraph. Disable the test with most of those for now; leave the two with only a handful of messages enabled.

* Correct Failures in 2 Stock Charts

Down to 6 templates on which Render fails.
2022-08-13 18:14:25 -07:00
dependabot[bot] 0719c7cb87 Bump dompdf/dompdf from 1.2.2 to 2.0.0 (#2917)
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 1.2.2 to 2.0.0.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v1.2.2...v2.0.0)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-01 05:21:24 -07:00
MarkBaker 3b55689ec1 phpcs update to version 3.7.0 to ensure it catches all the PHP 8.1 updates 2022-06-15 13:33:42 +02:00
dependabot[bot] ed7efb05f0 Bump mpdf/mpdf from 8.0.17 to 8.1.1 (#2793)
Bumps [mpdf/mpdf](https://github.com/mpdf/mpdf) from 8.0.17 to 8.1.1.
- [Release notes](https://github.com/mpdf/mpdf/releases)
- [Changelog](https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md)
- [Commits](https://github.com/mpdf/mpdf/compare/v8.0.17...v8.1.1)

---
updated-dependencies:
- dependency-name: mpdf/mpdf
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-01 07:17:07 -07:00
Kevin Bond 3a4da89bfe allow psr/simple-cache 2.x 2022-03-11 11:33:16 -05:00
dependabot[bot] 9e591d8540 Bump mpdf/mpdf from 8.0.15 to 8.0.17 (#2543)
Bumps [mpdf/mpdf](https://github.com/mpdf/mpdf) from 8.0.15 to 8.0.17.
- [Release notes](https://github.com/mpdf/mpdf/releases)
- [Changelog](https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md)
- [Commits](https://github.com/mpdf/mpdf/compare/v8.0.15...v8.0.17)

---
updated-dependencies:
- dependency-name: mpdf/mpdf
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 18:15:07 -08:00
oleibman 2f0668017b Plugin in composer.json (#2502)
Per https://getcomposer.org/doc/06-config.md#allow-plugins, Composer has added an extra layer of security in V2.2, and will start enforcing it in July of this year. Phpcodesniffer uses a plugin and will be affected if composer.json isn't updated before that date.

Co-authored-by: Mark Baker <mark@lange.demon.co.uk>
2022-01-20 12:03:21 +01:00
Mark Baker 0df5daaa8b Fix mpdf to version 8.0.15, as 8.0.16 has logger signature issues (#2514) 2022-01-20 11:48:44 +01:00
Adrien Crivelli 49d47d4bb4 Update all deps 2021-11-08 10:20:47 +09:00
dependabot[bot] 2bffcf9fa8 Bump phpunit/phpunit from 8.5.21 to 9.5.10
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 8.5.21 to 9.5.10.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-8.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/8.5.21...9.5.10)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 08:54:58 +09:00
dependabot[bot] 10b1371c6e Bump friendsofphp/php-cs-fixer from 2.19.2 to 3.2.1 (#2365)
* Bump friendsofphp/php-cs-fixer from 2.19.2 to 3.2.1

Bumps [friendsofphp/php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) from 2.19.2 to 3.2.1.
- [Release notes](https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases)
- [Changelog](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.2.1/CHANGELOG.md)
- [Commits](https://github.com/FriendsOfPHP/PHP-CS-Fixer/compare/v2.19.2...v3.2.1)

---
updated-dependencies:
- dependency-name: friendsofphp/php-cs-fixer
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adrien Crivelli <adrien.crivelli@gmail.com>
2021-11-08 00:32:24 +09:00
Adrien Crivelli 858e073063 Drop PHP 7.2
This is according to our formal, published, policy to only support
eol PHP after 6 months.

See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
2021-11-01 12:01:54 +09:00
MarkBaker 10a69f9983 Update matrix library to version 3 2021-07-02 11:55:59 +02:00
Mark Baker 3ddd12a49b Update complex numbe library to version 3 (#2198) 2021-06-29 19:28:56 +02:00
MarkBaker f89bfc9e02 Additional language data, and improved automated build of translation files for Calculation Engine locale 2021-05-20 20:41:09 +02:00
MarkBaker e5bfc3c899 Add phpcs version compatibility check to pipeline 2021-05-10 22:55:32 +02:00
Adrien Crivelli 49f87de165 Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Adrien Crivelli a189d933f2 Introduce PHPStan
To improve the feedback loop on code quality with a process
that can be run locally by the developers, instead of only
on Scrutinizer.
2021-04-03 16:13:21 +09:00
Adrien Crivelli 924347c05a Update PHP deps
Simplify our constraints thanks to PHPUnit 8.5 that supports PHP 8+
2021-03-28 13:52:43 +09:00
MarkBaker cd2f260db1 Additional method call/return typing 2021-01-29 17:31:28 +01:00
MarkBaker 65837daa98 Named formula fix for empty formula value 2021-01-29 15:43:49 +01:00
Mark Baker 9289ab11b2 Replace anti-xss with html purifier (#1751)
* Replace voku/anti-xss with ezyang/htmlpurifier. Despite anti-xss being a smaller footprint dependency, an a better license fit with our MIT license, there are issues with it's automatic it sanitisation of global variables causing side effects
* Additional unit tests for xss in html writer cell comments
2020-12-10 21:03:54 +01:00
Mark Baker 0ed5b800be Resolve XSS Vulnerability in the HTML Writer (#1719)
Resolve XSS Vulnerability in the HTML Writer
2020-11-19 11:59:57 +01:00
MarkBaker 2d93c36a1a Update composer suggestions 2020-10-10 12:11:00 +02:00
MarkBaker 7d05e0557c Update to versions of complex and matrix libraries 2020-10-01 11:30:09 +02:00
MarkBaker 23e3a09dd3 Update to versions of complex and matrix libraries 2020-09-01 11:02:07 +02:00
MarkBaker 91185a93dc Starting from scratch again: PHP8 nightly build included in test run, and it should pickup PHPUnit >= 9.3 2020-08-09 14:12:17 +02:00
Adrien Crivelli 48f8b5c1f2 Move phpcs config to file 2020-07-26 14:48:06 +09:00
MarkBaker 16a9ff14d4 Experiment 2020-07-25 23:17:26 +02:00
Adrien Crivelli 7cb4884b96 WEBSERVICE is HTTP client agnostic
HTTP client must be configured via `Settings::setHttpClient()`. This is
a small breaking change, but only for the very few people who started using
WEBSERVICE from last version.

Fixes #1562
Closes #1568
2020-07-19 11:33:01 +09:00
paulkned 7f23ccb69d Added support for the WEBSERVICE function (#1409)
Co-authored-by: Paul Kievits <kievits@rsm.nl>
2020-06-29 10:17:58 +09:00