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

valkyrjaio / valkyrja-php / 30415598297
100%

Build:
DEFAULT BRANCH: 26.x
Ran 29 Jul 2026 02:01AM 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 01:59AM UTC coverage: 100.0%. Remained the same
30415598297

push

github

web-flow
[Cli] Remove the unreachable empty allowed responses clause from Answer::isValidResponse (#945)

# Description

`Answer::isValidResponse()` opened with a clause that can never evaluate
to `true`:

```php
return ($this->allowedResponses === [] && $validationCallable === null)
    || in_array($userResponse, $this->allowedResponses, true)
    || ($validationCallable !== null && $validationCallable($userResponse));
```

`$this->allowedResponses` is never empty. The constructor appends
`$defaultResponse` when it is
absent, and `withAllowedResponses()` does the same, so
`$this->allowedResponses === []` is always
`false` and the `$validationCallable === null` half is never even
evaluated. This was the one
branch in `Answer.php` that no test could reach (30/31 branches), found
while closing branch
coverage gaps.

Both halves of that dead clause arrived in the same commit
(`2c2583007`): _"Updating Answer to add
the default response to allowed responses, **and** fix validation if no
allowed responses or
validation callback were set."_ Before it, `isValidResponse()` was
`in_array(...) || callable(...)`,
so an `Answer` with neither an allowed list nor a callable could never
validate — and
`QuestionWriter::askQuestion()` re-asks until the response is valid, so
it looped forever. That one
bug was fixed two independent ways at once, and appending the default
response fully resolves it on
its own. The fallback clause has been redundant ever since.

The empty-allowed-responses case was therefore never meant to mean
"accept anything" — it meant
"such an `Answer` must be answerable." Accepting anything would also
contradict `QuestionWriter`,
which prints the allowed responses to the user as their valid choices.
The resulting semantics —
an `Answer` given neither an allowed-response list nor a validation
callable accepts only the
default response — is already asserted by the existing
`testValidationCallback()` and passes on
`26.x` today, so removing the clause is a no-op... (continued)

1 of 0 new or added lines in 0 files covered. (NaN%)

12593 of 12593 relevant lines covered (100.0%)

23.76 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30415598297.1 29 Jul 2026 02:01AM UTC 1138
100.0
GitHub Action Run
Source Files on build 30415598297
  • 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 #30415598297
  • 38d4ad14 on github
  • Prev Build on 26.x (#30330624561)
  • Next Build on 26.x (#30415702543)
  • 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