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

valkyrjaio / valkyrja-php / 30232758335
100%

Build:
DEFAULT BRANCH: 26.x
Ran 27 Jul 2026 02:43AM 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

27 Jul 2026 02:41AM UTC coverage: 100.0%. Remained the same
30232758335

push

github

web-flow
[Cli] Enforce option valid values in areValuesValid (#925)

# Description

CLI option `validValues` (the allowed values for an option) were stored,
exposed via getters/withers, and carried through the
`AttributeRouteCollector` to help output — but never actually enforced.
`areValuesValid()` only checked the option `mode` (`REQUIRED` ⇒ at least
one option present) and `valueMode` (`DEFAULT` ⇒ at most one option); it
never checked that a provided value was a member of `validValues`. As a
result an option declared with `validValues` such as `['json', 'xml']`
still accepted `--format=csv`.

This PR enforces `validValues` in `areValuesValid()`: when `validValues`
is non-empty, every bound option value must be a member of
`validValues`, otherwise `validateValues()` throws the existing
`CliRoutingOptionValuesValidationException`. An empty `validValues`
imposes no constraint (unchanged). The check composes with `valueMode`
`NONE`/`DEFAULT`/`ARRAY` (for `ARRAY`, every provided value must be
valid) and with `OptionMode` `REQUIRED`/`OPTIONAL`.

PHP is the reference implementation; the Java and TypeScript ports
mirror its behavior. This is one of three sibling PRs — see **Sibling
PRs** below.

## Types of changes

- [ ] Improvement _(non-breaking change which improves code)_
- [x] Bug fix _(non-breaking change which fixes an issue)_
- [ ] New feature _(non-breaking change which adds functionality)_
- [ ] Deprecation _(breaking change which removes functionality)_
- [ ] Breaking change _(fix or feature that would cause existing
functionality to change)_
- [ ] Documentation improvement

## Changes
- **`src/Valkyrja/Cli/Routing/Data/OptionParameter.php`** —
`areValuesValid()` now returns `false` (so `validateValues()` throws
`CliRoutingOptionValuesValidationException`) when any bound option value
is not a member of a non-empty `validValues` list; an empty list is
unconstrained.
- **`tests/Tests/Unit/Cli/Routing/Data/OptionParameterTest.php`** —
added combination tes... (continued)

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

12591 of 12591 relevant lines covered (100.0%)

17.33 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30232758335.1 27 Jul 2026 02:43AM UTC 1138
100.0
GitHub Action Run
Source Files on build 30232758335
  • 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 #30232758335
  • 3b930441 on github
  • Prev Build on 26.x (#30232707721)
  • Next Build on 26.x (#30233347644)
  • 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