Commit Graph
19 Commits
Author SHA1 Message Date
Jon Nott 887d6ef033 Add setCellVerticalAlignment() & allow setShouldWrapText() to be explicitly set as false
- add Common\Entity\Style\CellVerticalAlignment
- duplicate get/set/hasSet/shouldApply methods for CellAlignment in Common\Entity\Style\Style for CellVerticalAlignment instead, plus corresponding properties
- add setCellVerticalAlignment method to Common\Creator\Style\StyleBuilder
- add vertical alignment to StyleMerger:: mergeCellProperties()
- adjust wrapText logic in mergeCellProperties() to fix issue https://github.com/box/spout/issues/829
- apply vertical cell styling for both XLSX and ODS, via corresponding StyleManager classes
- transform vertical alignment  ‘center’ to ‘middle’ for ODS
- fix logic around wrapText such that the choice whether to include wrapping styles depends on hasSetWrapText() being true, and then use shouldWrapText() thereafter to either set wrapping or no wrapping (for XLSX, wrapText=“1” or wrapText=“0”, for ODS, wrap-option=wrap or wrap-option=no-wrap). previously there was no way to set wrapping to be OFF, only to set it to be ON.
- add new tests to ensure shouldWrapText(false) results in the correct negated wrapText (XLSX) / wrap-option (ODS) styles
- add new tests to StyleBuilderTest for vertical alignment
- add vertical alignment to documentation.md
2022-02-12 19:37:05 +00:00
Adrien Loison 9bdb027d31 Update documentation with number format 2021-05-14 23:18:09 +02:00
Andrii Dembitskyi 0f20c99a7f Fix constant usage in example 2021-02-10 10:53:55 +01:00
Petr Skoda 816596183f Add full support for PHP 8.0
Unfortunately due to PHPUnit 8.5 dependency
this also drops support for PHP 7.1
2021-02-08 14:31:55 +01:00
Adrien Loison 9f4c094fa0 Cell alignment
This PR adds support for cell alignment for XLSX and ODS files.
You can now align the content of the cells this way:
```
use Box\Spout\Common\Entity\Style\CellAlignment;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;

$style = (new StyleBuilder())
    ->setCellAlignment(CellAlignment::RIGHT)
    ->build();
...
```

Possible cell alignments are: LEFT, RIGHT, CENTER and JUSTIFY.
2019-10-27 18:58:56 +01:00
Adrien Loison 0a0b1f7196 [docs] Fix site_url - take 2 2019-10-17 13:12:40 +00:00
Adrien Loison db32a7c7db [docs] Fix site_url 2019-10-17 11:15:55 +00:00
Adrien Loison 859b8d336e [Docs] Force using current protocol scheme for resources and links
If the docs is accessed with https, change all links to be https as well.
2019-10-17 10:32:39 +00:00
Adrien Loison 8a2dcc946b Improve docs for local dev 2019-10-17 09:29:03 +00:00
Adrien Loison 74146c6224 Switch documentation site to HTTPS
Accessing the website through HTTP may be blocked in some regions of the world.
Using HTTPS should help with this problem and is the good thing to do anyway.
2019-10-17 07:44:13 +00:00
Ilya Troy 2d297e954b Update getting-started.md
Fix writer usage example
2019-07-30 22:14:20 +02:00
Adrien Loison a296f73a98 Fix Github icon in docs 2019-05-24 10:12:35 +02:00
Adrien Loison 9d33fcdd00 Update FAQ 2019-05-24 09:24:34 +02:00
Adrien Loison 40ee386edd Add helper functions to create specific readers and writers
Removed the `ReaderEntityFactory::createReader(Type)` method and replaced it by 3 methods:
- `ReaderEntityFactory::createCSVReader()`
- `ReaderEntityFactory::createXLSXReader()`
- `ReaderEntityFactory::createODSReader()`

This has the advantage of enabling autocomplete in the IDE, as the return type is no longer the interface but the concrete type. Since readers may expose different options, this is pretty useful.

Similarly, removed the `WriterEntityFactory::createWriter(Type)` method and replaced it by 3 methods:
- `WriterEntityFactory::createCSVWriter()`
- `WriterEntityFactory::createXLSXWriter()`
- `WriterEntityFactory::createODSWriter()`

Since this is a breaking change, I also updated the Upgrade guide.
Finally, the doc is up to date too.
2019-05-17 21:22:03 +02:00
Adrien Loison 4260c46b11 Update documentation for 3.0 2019-05-17 13:25:49 +02:00
madflow e99c80b3ad create a reader by file type #569 2018-10-23 13:33:39 +02:00
madflow 8f7f106555 doc update with new classes and signatures 2018-10-12 20:16:30 +02:00
madflow e1acdc1fc5 (docs) removed Bower, use a CDN, Docker usage, updated Readme 2018-08-09 23:52:14 +02:00
madflow cd0831ea8e #463, move gh-pages to docs folder 2017-11-26 20:02:20 +01:00