• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPOffice / PHPWord / 35970521500
97%

Build:
DEFAULT BRANCH: master
Ran 24 Sep 2026 08:02AM UTC
Jobs 1
Files 342
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Sep 2026 07:36AM UTC coverage: 96.514% (-0.1%) from 96.636%
35970521500

push

github

web-flow
Reader WPS: add Microsoft Works (.wps) text reader (#2935)

* Reader WPS: add Microsoft Works (.wps) text reader

Implements PhpOffice\PhpWord\Reader\WPS per issue #69:

- Reuses Shared\OLERead to parse the OLE compound container and extract the
  'CONTENTS' stream (handles both regular and mini streams).
- Walks the WPS chunk list: CHNKWKS magic, 0x01F8 chunk tags, TEXT chunk
  lookup with linked-block traversal.
- Decodes UTF-16LE text, normalizes \r line breaks, and maps paragraphs to
  Text elements in a single section.
- canRead() validates the OLE signature + CHNKWKS magic (gracefully false
  for non-OLE/non-WPS files).
- Ships a generated CFB/WPS fixture (tests/_files/documents/reader.wps) with
  3 known paragraphs, plus unit tests: canRead true/false, full load with
  exact text assertions.

Verification: phpunit WPSTest 3/3 green; phpstan analyse clean; php-cs-fixer
0 fixable violations across the repo.

* fix: handle false returns from preg_split() and unpack() flagged by PHPStan

The CI static analysis config (full phpstan.neon.dist) is stricter than a
single-file level-6 run: preg_split() and unpack() both return array|false.
Throw a dedicated Exception on the impossible-by-construction failure paths
so the types are honest and the analysis passes on PHP 7.1-8.5.

* Reader WPS: address review feedback

- Rebase on current master (WPS Writer #2929 merged)
- Add Reader WPS entry to docs/changes/1.x/1.5.0.md
- Make internal helpers protected and non-static
- Align @since with 1.5.0

* Reader WPS: add types to methods per review feedback

Apply the return type and native type hints requested in review on the
protected helpers (no inheritance constraints) and add return types on
canRead()/load().

Note on canRead()/load(): the parameter types from the review
suggestions (string $filename / string $docFile) cannot be applied
right now because AbstractReader and ReaderInterface declare canRead()
and load() without parameter types, and PHP require... (continued)

51 of 70 new or added lines in 1 file covered. (72.86%)

13207 of 13684 relevant lines covered (96.51%)

36.55 hits per line

Uncovered Changes

Lines Coverage ∆ File
19
72.86
src/PhpWord/Reader/WPS.php
Jobs
ID Job ID Ran Files Coverage
1 35970521500.1 24 Sep 2026 08:01AM UTC 342
96.51
GitHub Action Run
Source Files on build 35970521500
  • Tree
  • List 342
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 599e438d on github
  • Prev Build on master (#35854150054)
  • Next Build on master (#36327120966)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc