Commit Graph

3599 Commits

Author SHA1 Message Date
Mark Baker 85fe696236
Merge pull request #2889 from PHPOffice/PHPCS-Update
phpcs update to version 3.7.0
2022-06-15 13:43:48 +02: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
Mark Baker 1a404e8dcf
Merge pull request #2888 from PHPOffice/ReferenceHelper-Performance-Improvements
Reference helper performance improvements
2022-06-15 13:23:51 +02:00
Mark Baker ec5e46a0ba
Merge branch 'master' into ReferenceHelper-Performance-Improvements 2022-06-15 13:10:40 +02:00
MarkBaker f51f4bc0ea Update change log and documentation 2022-06-15 12:59:38 +02:00
MarkBaker 09c66ab302 Use column address rather than index for remove column loop to eliminate extra math and repeated calls to stringFromColumnIndex() 2022-06-15 12:59:37 +02:00
oleibman 04f4667658
Expand Chart Support for schemeClr and prstClr (#2879)
* Expand Chart Support for schemeClr and prstClr

Fix #2219. Address some, but not all, issues mentioned in #2863.

For Pie Charts, fill color is stored in XML as part of dPt node, which had been ignored by Reader/Xlsx/Chart. Add support for it, including when specified as schemeClr or prstClr rather than srgbClr. Add support for prstClr in other cases where schemeClr is supported.

* Update Change Log

Add this PR.
2022-06-14 08:45:12 -07:00
oleibman 90bdc7c12e
Test For Excel File Saved With Ribbon Data (#2883)
File from https://www.rondebruin.nl/win/s2/win003.htm. I have been in conversation with the author, who has no objection to its use. I have not actually opened the file in Excel (at least not with macros enabled); I am using it merely to demonstrate that the ribbon data is read and written correctly. Test added; no source code changed. This should slightly increase coverage for Reader/Xlsx (moderate), Writer/Xlsx (slight), and Spreadsheet (substantial). Note that this file has no Ribbon Bin objects, so some coverage is still lacking.
2022-06-14 08:33:36 -07:00
MarkBaker 00f570aed5 Merge branch 'master' into ReferenceHelper-Performance-Improvements 2022-06-14 16:00:09 +02:00
Mark Baker ed34a45891
Merge pull request #2875 from dgeppo/master
Add removeCommentByColumnAndRow function
2022-06-14 12:46:51 +02:00
Mark Baker c749cb5e83
Merge branch 'master' into master 2022-06-14 12:34:02 +02:00
MarkBaker 8e31dbaabe Update change log 2022-06-14 12:21:44 +02:00
MarkBaker 4d2b00dafc phpcs fxes 2022-06-14 12:19:54 +02:00
MarkBaker 11a94dabec Potential improvements for insert/delete column/row for performance testing 2022-06-14 12:01:08 +02:00
Dams 7f62fba7ef
Update the method testRemoveComment
Adding test to check if comment exists before delete it
2022-06-14 10:44:42 +02:00
Dams 861b955b3b
Add feature removeComment
Use $cellCoordinate as argument
Return $this to support the fluent interface
2022-06-14 10:12:08 +02:00
Mark Baker 7b7d3bc33c
Merge pull request #2882 from PHPOffice/Datatype-Stricter-Typing
Apply some coercive type-hinting
2022-06-12 19:57:56 +02:00
MarkBaker 09c843427f Apply some coercive type-hinting 2022-06-12 19:21:43 +02:00
Mark Baker 67f87c87c2
Merge pull request #2880 from PHPOffice/Tighten-up-TypeChecking-for-Strings
Apply some coercive type-hinting
2022-06-11 14:46:48 +02:00
MarkBaker 189152ee07 Apply some coercive type-hinting 2022-06-11 14:32:29 +02:00
Mark Baker 5cba6d86e6
Merge pull request #2873 from PHPOffice/Row/Column_isEmpty-check
New functionality to allow checking whether a row or column is "empty"
2022-06-10 17:37:43 +02:00
Mark Baker 0ef98ac044
Merge branch 'master' into Row/Column_isEmpty-check 2022-06-10 17:34:11 +02:00
Mark Baker e3471f8a0f
Merge pull request #2878 from PHPOffice/Issue-2868_Emphasis-Documentation-for-setValueExplict
Update docblock documentation for setting cell values explicit
2022-06-10 14:37:24 +02:00
MarkBaker 8434189336 Update docblock documentation for setting cell values explicit to indicate that value/datatype matching is the responsibility of the end-user developer making this call; and that values may be changed to reflect the specified datatype.
No doubt some developers will complain that it should be the other way round, that datatpe should be modified to match the specified value; but then they should be using setValue() instead; the use of setValueExplicit() is explicit.
2022-06-10 13:38:41 +02:00
oleibman 4f22b39b89
Add Support to Chart/Axis and Gridlines for Shadow (#2872)
* Add Support to Chart/Axis and Gridlines for Shadow

Continuing the work from #2865. Support is added for Shadow properties for Axis and Gridlines, and Glow and SoftEdges are extended to Gridlines. Tests are added. Some chart tests are moved from Reader/Xlsx and Writer/Xlsx so that most chart tests are under a single directory.

This is a minor breaking change. Since the support for these properties was just added, it can't really affect much in userland. Some properties had been stored in the form which the XML requires them rather than as the user would enter them to Excel. So, for example, setting the Glow size to 10 points would have caused it to be stored internally as 127,000. This change will store the size internally as 10, obviously making the appropriate conversion when reading from or writing to XML. This makes unit tests much simpler, and I think this is also what a user would expect, especially considering the difficulties in keeping track of the trailing zeros.

* More Tests

Confirm value change between internal and xml.

* Still More Tests

Add a little more coverage, and use a neat trick suggested by @MarkBaker in the discussion of PR #2724 to greatly simplify MultiplierTest.
2022-06-09 18:08:56 -07:00
Mark Baker 1f1fc360af
Merge pull request #2877 from PHPOffice/Issue-2776_Allow-Merge-Cells-for-single-cell
Relax validation on merge cells to allow input of a single cell
2022-06-10 01:27:29 +02:00
MarkBaker 00dae1bbda Relax validation on merge cells to allow input of a single cell 2022-06-10 01:15:57 +02:00
MarkBaker adf4531c99 Adjust worksheet regexps for CellRef and Row/Column Ranges for improved handling of quoted worksheet names 2022-06-09 19:54:25 +02:00
Dams 801f5296e9
Update Worksheet.php 2022-06-09 09:21:18 +02:00
Dams 52da0dc0fc
Add use PhpOffice\PhpSpreadsheet\Spreadsheet; 2022-06-09 09:18:48 +02:00
Dams 56ddbc4dd5
Add testRemoveComment 2022-06-09 09:08:52 +02:00
Dams 13437384af
Change removeComment to use CellCoordinate 2022-06-09 09:08:02 +02:00
dgeppo 391e6308d7
Add removeCommentByColumnAndRow function 2022-06-08 11:24:56 +02:00
MarkBaker b62de98bf7 New functionality to allow checking whether a row or column is "empty", with flags to allow variation in the definition of "empty" 2022-06-07 20:22:33 +02:00
oleibman 5608e05eda
Add Support to Chart/Axis for Glow/SoftEdges (#2865)
* Add Support to Chart/Axis for Glow/SoftEdges

Chart is very under-covered in unit tests. I was hoping to just add some tests and be done with it, but that just won't suffice - many code changes are required. Adding Glow properties for Axis turned out to be a real mixed bag - no support in Xlsx/Reader at all, support in Xlsx/Writer ... for the X-axis only. So we'll just inch forward in many stages.

This change does not address other Axis properties (Fill, Shadow, Line, LineStyle, and maybe others, and their sub-properties). On my to-do list.

GridLines, and maybe other Chart objects, also should support these properties. This change does not address those. On my to-do list.

No support is added for spreadsheet formats other than Xlsx.

* Refactoring

This should make the code easier to follow, and I hope it will also be extensible to other object types (e.g. GridLines).

* More Refactoring

Make scheme/srgb easier to handle.

* Fix Typo

In a very rarely used function.
2022-06-03 16:47:03 -07:00
dependabot[bot] d0ff3d9ca7
Bump phpstan/phpstan from 1.6.3 to 1.7.7 (#2864)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.6.3 to 1.7.7.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.6.3...1.7.7)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  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>
Co-authored-by: oleibman <10341515+oleibman@users.noreply.github.com>
2022-06-01 21:22:53 -07:00
oleibman 8bb568c9ac
Prep Work Before Upgrading to Phpstan 1.7.7 (#2867)
Clean up the usual discrepancies which arise between Phpstan releases.
2022-06-01 21:10:41 -07:00
oleibman c936f1d9f8
Coverage Improvements (#2859)
Mostly new tests, some code annotations, some minor code changes:
- RichText clone logic is wrong
- TextElement doesn't have object properties, doesn't need clone
2022-06-01 08:29:56 -07:00
Tomas Votruba 0aedef4902
Update excel migration with sets() method (#2861) 2022-05-31 07:19:43 -07:00
oleibman ab52991dc6
More Bubble Chart Fixes (#2856)
Continuing the work from #2828, #2841, #2846, and #2852. This is probably my last change in this area for a while.

Bubble charts can have bubbles of different sizes. Phpspreadsheet had not supported this. Openpyxl comes with sample code to generate such a chart. I was especially drawn to that solution because its namespace usage would have been unexpected before 2852. And it turned out to come with other surprises - use of absolute paths in the .rels files (PhpSpreadsheet expected only relative), use of a one-cell anchor to place the chart (PhpSpreadsheet expected two-cell anchor or absolute positioning), plaintext in the legend (Phpspreadsheet expected RichText), no cached values for chart data. Excel handles the file okay, and this PR makes sure PhpSpreadsheet does as well. This file is now Samples/Templates/32readwriteBubbleChart2, and is used for both generating a sample output file and in formal tests. A new sample in the 33* series demonstrates how to code these.
2022-05-28 18:45:47 -07:00
Mark Baker 273d16e6a3
Merge pull request #2857 from PHPOffice/Minor-Documentation-Updates
Minor documentation updates
2022-05-26 15:28:35 +02:00
Mark Baker daffce00d6
Merge pull request #2858 from PHPOffice/PhpStan-Cleanups
Declare a few return datatypes
2022-05-26 15:28:07 +02:00
MarkBaker 3302701ae7 Declare a few return datatypes 2022-05-26 15:20:41 +02:00
MarkBaker 8089c9bf20 Declare a few return datatypes 2022-05-25 18:38:54 +02:00
Mark Baker dfd043295e
Merge pull request #2854 from PHPOffice/PHPStan-Cleanup-Regexp-String-Casting
Php stan cleanup regexp string casting
2022-05-25 17:33:17 +02:00
MarkBaker ff8f801043 Use preg_replace() with arrays, where appropriate, because it's more efficient that caling several times 2022-05-25 13:32:06 +02:00
MarkBaker bf46ff1e0c Explicit type-cast result from preg_replace() calls to string, cleans up a few phpstan issues 2022-05-25 12:36:25 +02:00
oleibman 9e4ff929b4
Namespacing Part 3 - Charts (#2852)
* Namespacing Part 3 - Charts

Charts still need some work, but they are now in good enough shape that the code that reads them can handle namespacing properly. Rather than a set of static routines, Reader/Xlsx/Chart needs to be changed to a regular object, with the relevant namespaces passed in the constructor. I am still looking for a test spreadsheet with non-standard namespacing for a full-blown test, but, in the meantime, the existing tests and samples will suffice. When I find a test case, I will certainly add it.

The resulting code is actually simpler than it had been because of the elimination of the need for a NamespacesMeta variable in all the function signatures. Because of that, enough errors disappeared from Phpstan that I decided to just finish that job - its baseline file now dips below 5,000 lines.

* Update Change Log

Need to document many chart changes.
2022-05-25 00:56:26 -07:00
Mark Baker 13e1b9a939
Merge pull request #2853 from PHPOffice/Gnumeric-Reader-Worksheet-Visibility
Add support for reading Worksheet Visibility for Gnumeric
2022-05-24 15:33:34 +02:00
MarkBaker c26215fdab Update Change Log 2022-05-24 14:40:45 +02:00