Commit Graph

4 Commits

Author SHA1 Message Date
oleibman d0fae3f57a Eliminate Some Phpstan Annotations (#3746)
* Eliminate Some Phpstan Annotations

Some changes are possible due to Php8+ features like null-safe operators and Stringable.

* Possible Uninitialized Variable

Scrutinizer might be technically correct.

* CellAddress Static -> Self

I don't understand the use case for extending it, which would be the reason for using static rather than self.

* Update Worksheet.php
2023-09-30 08:48:02 -07:00
Adrien Crivelli ec4098c8fd Strict mode for all tests
While we might never be able to have 100% of our code strict, we can at
the very least do it for all of our tests. This ensures that our tests
are using our API with the types as intended by the test author, and not
silently be cast to what our API requires.
2023-09-07 17:44:56 +08:00
oleibman 29b07a7c86 Namespace-Aware Code for SheetViewOptions, SheetProtection (minor break) (#3230)
* Namespace-Aware Code for SheetViewOptions, SheetProtection (minor break)

This is fairly straightforward for SheetViewOptions.

SheetProtection is a bit less straightforward. All the attributes should allow for null as well as boolean; this is especially important because Excel defaults to true for some of them and false for others (existing code always treated attributes missing from the XML as false). DocBlocks are updated to indicate the defaults. The test for isProtectionEnabled is changed to reflect this reality. Also, PhpSpreadsheet has been using true/false when writing these, but Excel uses 1/0. Because of these differences, this is a breaking change, but the consequences of the breaks should be minor. Two unit test results needed to change.

Remaining areas in Reader/Xlsx which still use the namespace-unaware code include conditional formatting (internal or external), auto filters, unparsed loaded data, data validation (internal or external), alternate content, and header/footer images.

* Corrections to Xls Reader and Writer

New test and changed sample to go with code changes. Also doc change.
2022-12-11 17:38:26 -08:00
Adrien Crivelli b9a59660d0 Password and hash are exclusive
As specified in https://docs.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/85f5567f-2599-41ad-ae26-8cfab23ce754
password and hashValue are exlusive and thus should be treated
transparently with a single API in our model.
2020-05-31 22:36:37 +09:00