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

PHPOffice / PHPPresentation / 32939816605
95%

Build:
DEFAULT BRANCH: master
Ran 26 Aug 2026 06:52AM UTC
Jobs 1
Files 141
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

26 Aug 2026 06:49AM UTC coverage: 92.919% (+0.1%) from 92.805%
32939816605

push

github

web-flow
Replace a shadow set to null with a fresh one, rather than storing the null (#928)

`AbstractShape::setShadow()` takes `?Shadow` and stores whatever it is given, so
`getShadow()` returns `?Shadow`. Every writer reads it without asking whether it is
there, and every one of them takes a non-nullable `Shadow`. Measured on a shape
that asked for its shadow to be taken away:

    HTML             OK        (a text body has no shadow in this writer)
    PowerPoint2007   TypeError AbstractSlide::writeShadow(): Argument #2
    ODPresentation   TypeError Content::writeStylePartShadow(): Argument #2
    HTML + image     TypeError HTML::getStyleShadow(): Argument #1
    HTML + video     TypeError HTML::getStyleShadow(): Argument #1

Five crash sites across three writers, from one setter. Guarding each call is
five guards for a state the model should not hold in the first place: a shape is
*born* with `new Shadow()`, and one that is asked to give it up has no business
becoming a shape that has none -- `Shadow` already carries `isVisible()` for
saying so. So the setter replaces a null with a fresh shadow, and `getShadow()`
narrows to `Shadow`.

Same treatment `setFont()` got in #924, and the same reason: a setter that accepts
null is a promise the writers cannot keep.

The `isset($this->shadow)` guard in `__clone()` goes with it -- the property is
always set now, so the clone is unconditional, as it already was for `$border`.

Reported by @phili67 in #887, which guards one of the five sites from inside the
HTML writer.

A sixth reader, asked for on the PR: `PptCharts.php:186` reads
`$chart->getShadow()->isVisible()`, so a chart whose shadow was nulled dies as
`Error: Call to a member function isVisible() on null` -- a different error
class from the five `TypeError`s, which is why looking for a non-nullable
parameter did not find it. The setter fix already covers it; the tests now do
too, and they cover every reader rather than two of six: `writeShapePic()` in
the ... (continued)

2 of 2 new or added lines in 1 file covered. (100.0%)

10472 of 11270 relevant lines covered (92.92%)

58.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 32939816605.1 26 Aug 2026 06:52AM UTC 141
92.92
GitHub Action Run
Source Files on build 32939816605
  • Tree
  • List 141
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 74954c77 on github
  • Prev Build on master (#32891891486)
  • Next Build on master (#32941136472)
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