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

valkyrjaio / valkyrja-java / 30322506389
100%

Build:
DEFAULT BRANCH: 26.x
Ran 28 Jul 2026 02:14AM UTC
Jobs 1
Files 653
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

28 Jul 2026 02:13AM UTC coverage: 99.977%. Remained the same
30322506389

push

github

web-flow
[Cli] Bind options and validate parameters during route dispatch (#53)

# Description

The CLI `Router` only ever bound *arguments*. Its `dispatch` called a
local `bindArguments` helper
and stopped there, so two things the PHP reference does never happened
in Java:

- **Options on the input were ignored.** Nothing ever matched an input
option against a route's
`OptionParameter`, so a command declaring `--force` / `-f` received
nothing no matter what the
user typed. The data classes already had `withOptions` /
`withAddedOptions` and short-name
  support — the router simply never called them.
- **Validation never ran.** `ArgumentParameter.validateValues()` and
`OptionParameter.validateValues()` were fully implemented and fully
tested in isolation, but no
production code path invoked them. `REQUIRED`, `DEFAULT`, `NONE` and
valid-values enforcement
were therefore dead at dispatch: a command declaring a required argument
or option would happily
  dispatch with it missing.

Beyond that, the bound route never reached the container, so a handler
calling
`container.get(RouteContract.class)` could not resolve the command it
was running, and the route's
own middleware was never registered on the four handlers — CLI
route-level middleware silently did
not run. The Java HTTP `Router` already does both correctly; the CLI
port was the outlier.

This ports
`Valkyrja\Cli\Routing\Dispatcher\Router::addParametersToRoute` /
`addArgumentsToRoute` / `addOptionsToRoute` / `routeMatched` faithfully,
so CLI dispatch in Java now
behaves as PHP does.

Two changes are visible in behavior for routes that already worked,
which is why this is a bug fix
rather than an improvement:

- A route declaring a `REQUIRED` argument that the input does not supply
previously dispatched
successfully; it now throws
`CliRoutingArgumentValuesValidationException`, as in PHP.
- An `ARRAY` argument parameter no longer has to be declared last. The
old code gated on
`isLast && ARRAY`; PHP consumes the ... (continued)

1870 of 1872 branches covered (99.89%)

Branch coverage included in aggregate %.

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

6836 of 6836 relevant lines covered (100.0%)

4.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30322506389.1 28 Jul 2026 02:14AM UTC 653
99.98
GitHub Action Run
Source Files on build 30322506389
  • Tree
  • List 653
  • Changed 5
  • Source Changed 5
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30322506389
  • f51151e4 on github
  • Prev Build on 26.x (#30322446063)
  • Next Build on 26.x (#30323111914)
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