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

valkyrjaio / valkyrja-php / 30416951256
100%

Build:
DEFAULT BRANCH: 26.x
Ran 29 Jul 2026 02:31AM UTC
Jobs 1
Files 1138
Run time 2min
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

29 Jul 2026 02:29AM UTC coverage: 100.0%. Remained the same
30416951256

push

github

web-flow
[Cli] Remove the always-true allowed responses check from QuestionWriter::writeQuestion (#948)

# Description

`QuestionWriter::writeQuestion()` guarded the allowed-response list with
a condition that can never
be `false`:

```php
$validResponses = $answer->getAllowedResponses();

if ($validResponses !== []) {
    // (`valid` or `also valid` or `another valid value`)
    ...
}
```

An `Answer` always carries at least its default response — the
constructor appends it when absent,
and `withAllowedResponses()` and `withDefaultResponse()` both re-add it
— so `getAllowedResponses()`
never returns an empty array and the guard is always taken. This is the
same invariant that made the
first clause of `Answer::isValidResponse()` dead code in #945; this is
the other place that assumed
otherwise.

Unlike #945, this was **not** visible as a branch-coverage gap, which is
worth recording. Xdebug
counts basic blocks *hit*, not edges *taken*: because the condition is
always true, control flows
entry to if-body to after-if, so all three blocks execute and
`writeQuestion` reported 100% branch
coverage. The unreachable edge showed up only in **path** coverage,
which is report-only and gated
by nothing. Measured per function on the `Cli` shard:

| `writeQuestion` | branches | paths |
|-----------------|----------|-------|
| before          | 3/3      | 1/2   |
| after           | 1/1      | 1/1   |

Behavior is unchanged: the guard was always taken, so the same messages
are written in the same
order. The Java port already does exactly this and documents the
invariant in place; the comment
added here is worded to match `QuestionWriter.java`, so the ports read
alike. The TypeScript port
still has both this and the `Answer` issue, tracked separately.

## Types of changes

- [x] Improvement _(non-breaking change which improves code)_
- [ ] Bug fix _(non-breaking change which fixes an issue)_
- [ ] New feature _(non-breaking change which adds functionality)_
- [ ] Deprecation... (continued)

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

12594 of 12594 relevant lines covered (100.0%)

23.75 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30416951256.1 29 Jul 2026 02:31AM UTC 1138
100.0
GitHub Action Run
Source Files on build 30416951256
  • Tree
  • List 1138
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30416951256
  • 9bb561bd on github
  • Prev Build on 26.x (#30416416065)
  • Next Build on 26.x (#30417050344)
  • Delete
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