Commit Graph

262 Commits

Author SHA1 Message Date
oleibman 66422b11b4 Formal Support for Php8.5
Ran into a surprising hitch when Php8.5 failed unit tests despite nightly succeeding. Duplicated problem locally, and fixed it with a Phpunit upgrade. Hopefully that will work on Github as well.
2025-11-21 16:19:08 -08:00
gertdepagter 1adad7565c Fix phpstan issues by making Escher generic
This removes the need to check if a method exists
2025-10-23 21:47:13 +02:00
oleibman 5a9055ca6a Phpstan Level 10 (Final)
Fix all of Statistical. We can now use Level 10 going forward.
2025-05-22 17:48:30 -07:00
oleibman 770eddf69d Still More Prep for Phpstan 10
Remaining:
- Calculation/LookupRef
- Calculation/Statistical
- Shared/OLE
- Odds and ends
2025-05-15 08:19:39 -07:00
oleibman 7db6e1f491 More prep for Phpstan 10 2025-05-12 22:59:34 -07:00
oleibman e53a04b016 Start Calculation Changes 2025-05-08 22:44:13 -07:00
oleibman 5c94de34a9 More Phpstan Level 10 Prep - Readers
Also upgrade Phpstan.
2025-05-03 21:18:55 -07:00
oleibman e32447c4be Phpstan Level 9: Last 2025-03-31 21:53:47 -07:00
oleibman 4323fcff5a Merge pull request #4428 from oleibman/stan2lv908
Phpstan Level 9 - Part 8 of Many - TextData
2025-03-31 13:09:38 +00:00
oleibman 078846cc8e Phpstan Level 9 - Part 8 of Many - TextData 2025-03-29 07:22:44 -07:00
oleibman 00ededb379 Phpstan Level 9 - Part 7 of Many: Functions, LookupRef 2025-03-29 06:53:41 -07:00
oleibman 729c4dc9e0 Merge pull request #4421 from oleibman/stan2lv906
Phpstan Level 9 - Part 6 of Many (Shared/OLE)
2025-03-28 05:43:33 +00:00
oleibman 5a486a1857 Phpstan Level 9 - Part 6 or Many (Shared/OLE) 2025-03-23 12:40:25 -07:00
oleibman e3ef02a422 Phpstan Level 9 - Part 5 of Many
Calculation: Database through Financial.
2025-03-23 00:55:48 -07:00
oleibman 3cb7b36746 Merge pull request #4410 from oleibman/stan2lv904
Phpstan Level 9 - Part 4 of Many
2025-03-20 03:52:32 +00:00
oleibman 06ddcfbd7f Phpstan Level 9 - Part 4 of Many
Mostly Calculation/Calculation.
2025-03-15 23:05:22 -07:00
oleibman 54210e4c07 Phpstan Level 9 - Part 3 of Many
All src modules except Calculation/* and Shared/OLE/*.
2025-03-15 22:41:31 -07:00
oleibman 74dca30c89 Merge pull request #4399 from oleibman/stan2lv902
Phpstan Level 9 - Part 2 of Many
2025-03-13 15:39:34 +00:00
oleibman c3ea02ec01 Merge branch 'master' into localesplit2 2025-03-12 00:34:59 -07:00
oleibman 6e1f3b909c More Phpstan
Having Trend:calculate return BestFit rather than mixed eliminates many Phpstan messages in baseline.neon.
2025-03-09 21:56:32 -07:00
oleibman c84960fb69 Phpstan Level 9 - Part 2 of Many 2025-03-08 23:22:15 -08:00
oleibman 156a12c0a4 Move Locale Logic in Calculation to Separate Class
Make things more maintainable (I hope).
2025-03-07 23:55:44 -08:00
oleibman d1d12ed92d Phpstan Level 9 - Part 1 of Many
Dealing mostly with mixed variable type. In a great many cases, problems can be resolved replacing `getValue` with `getValueString` or `getCalculatedValue` with `getCalculatedValueString`.
2025-03-05 21:59:54 -08:00
oleibman 00e77f1ac1 Phpstan Bleeding Edge Last: Reader 2025-02-23 17:32:44 -08:00
oleibman 27213ae6ab Phpstan Bleeding Edge Part 5: All But Reader 2025-02-21 22:55:54 -08:00
oleibman 0c5808e166 Merge pull request #4372 from oleibman/stanbleed04
Phpstan Bleeding Edge Part 4: Calculation
2025-02-22 00:05:16 +00:00
oleibman 09eacd332b Phpstan Bleeding Edge Part 4: Calculation 2025-02-17 12:02:06 -08:00
oleibman 753af27c9b Phpstan Bleeding Edge Part 3: Writer 2025-02-16 12:32:51 -08:00
oleibman ec773bbed9 Phpstan Bleeding Edge Part 2 of Many
This will be the biggest of these changes. It takes care of all of the remaining problems in tests. I will handle the problems in src more slowly.
2025-02-15 19:18:39 -08:00
oleibman 898fa0bf60 Phpstan Bleeding Edge Part 1 of Many
We currently use Phpstan Release 1. Release 2 has been available for some time, and we would like to stay current if possible. In order to get to Release 2, we first have to pass the "bleeding edge" tests for Release 1. I will do this by generating a new baseline using bleeding edge, then fix the baseline errors over several different PR's. This is the first of those.
2025-02-12 07:48:32 -08:00
oleibman 1ac1e7f11f Eliminate Some Phpstan-ignore Annotations
This PR resolves about half the statements which we tell Phpstan to ignore. There will still be 23 such annotations spread over 10 source modules for various reasons (too complicated, suspect PhpSpreadsheet code, one Phpstan bug), plus some deliberate errors in the test suite.
2024-02-08 21:14:14 -08:00
oleibman 101a31bc24 Phpstan Fixes
Reduce baseline.neon to a single entry.
2024-02-04 20:26:29 -08:00
oleibman a444d1c41f Merge pull request #3891 from oleibman/stanarray
Phpstan and ArrayEnabled
2024-02-04 07:11:15 +00:00
oleibman 6b4cbf1f68 Phpstan and ArrayEnabled
Phpstan baseline had been reduced to almost nothing, but recently had a big bump in size. Almost all of the increase was due to trait ArrayEnabled, which is easily recoded to avoid the problems.
2024-02-03 22:16:16 -08:00
oleibman b3de003aa5 Reorganize Samples
The samples have become unwieldy when running them from a browser. In particular, the drop-down lists are fixed size with no scrolling, and many of them are now just too large. I have moved all the Calculation samples up a level, and broken several categories (Basic, Chart, DateTime, Engineering, Financial, and Reader) into several pieces.

Convert-Online (now found in the Engineering category) had a number of different problems which are now resolved. It is the only member with any significant code change.
2024-02-03 07:25:29 -08:00
Adrien Crivelli b22fde2281 Upgrade QA tools 2024-01-04 13:06:59 +08:00
Adrien Crivelli 5cc1ece805 PhpStan 2024-01-04 11:56:46 +08:00
Adrien Crivelli bab6fc4e24 More @param to native types 2023-12-11 09:06:11 +01:00
Adrien Crivelli 5d716b7908 Apply PhpCsFixer phpdoc_to_return_type 2023-12-10 10:01:04 +01:00
Adrien Crivelli 77e6cc528c Apply PhpCsFixer phpdoc_to_property_type 2023-12-10 09:16:38 +01:00
Adrien Crivelli c303df2408 Type all interfaces 2023-12-09 16:47:25 +01:00
Adrien Crivelli 2da85155bd Fix PHPStan errors 2023-09-21 11:14:48 +08: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
Adrien Crivelli 23b95e24c7 Stronger typing for ranges 2023-09-20 17:49:22 +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 33eefe7c9d Resolve Phpstan Messages - FINALE - Shared/OLE (#3364)
* Resolve Phpstan Messages - FINALE - Shared/OLE

Reduce number of Phpstan messages by addressing their issues. This is the last of a series of related tickets to achieve that end. Only a handful of messages will be left in Phpstan baseline after this change is merged.

Shared/Ole.php and Shared/Ole/ChainedBlockStream.php were completely uncovered in the test suite. So I wrote some tests and found they didn't work at all. There were 2 problems. The first was that ChainedBlockStream checks for a mode of `r`, but Ole invokes it with mode `rb`. ChainedBlockStream will now just check the first character of the mode.

The second was a more interesting problem. Ole was reading "an *unsigned* long". However, what it should have been reading was "a 32-bit *signed* long". The irony of this mismatch is that, once the mode problem was corrected, 32-bit Php handled Ole and ChainedBlockStream correctly, but 64-bit Php did not. The code is corrected to work properly for both 32- and 64-bit.

* Scrutinizer

2 dead assignments - sufficient to just make calls which are expected to fail.
2023-02-20 06:40:02 -08:00
oleibman 1f94687f1c Resolve Phpstan Messages - Writer Xls Worksheet (#3363)
Reduce number of Phpstan messages by addressing their issues.
2023-02-18 07:44:26 -08:00
oleibman 9e1378d806 Resolve Phpstan Messages - Statistical/Trend and Shared/Trend (#3362)
* Resolve Phpstan Messages - Statistical/Trend and Shared/Trend

Reduce number of Phpstan messages by addressing their issues. The changes in this PR are all to doc blocks; no executable code is changed.

* Scrutinizer

1 mystifying "new" error (matches "old" error), 2 updated doc blocks.
2023-02-16 19:18:02 -08:00
oleibman 545fc89d8f Resolve Phpstan Messages Reader/Xls Shared/Escher (#3355)
* Resolve Phpstan Messages Reader/Xls Shared/Escher

Reduce number of Phpstan messages by addressing their issues.

* Scrutinizer

Hyperactivity.

* More Scrutinizer

Getting close.

* Even More Scrutinizer

Closer and closer.
2023-02-11 17:21:19 -08:00
oleibman 5fb76c83ef Resolve Phpstan Messages in Writer Xls (#3343)
* Resolve Phpstan Messages in Writer Xls

Reduce number of Phpstan messages by addressing their issues. This change does not touch Worksheet, and does not eliminate all Phpstan problems in the modules it does touch.

* Scrutinizer

Yet another false positive.
2023-02-07 07:02:27 -08:00