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

valkyrjaio / valkyrja-php / 30719344272
100%

Build:
DEFAULT BRANCH: 26.x
Ran 01 Aug 2026 09:34PM UTC
Jobs 1
Files 1144
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

01 Aug 2026 09:32PM UTC coverage: 100.0%. Remained the same
30719344272

push

github

web-flow
[Http] refactor: Move the static validators off the message collections (#1009)

# Description

A data object holds data and the behavior of its own state. It does not
hold a
static method. `valkyrjaio/architecture#128` records the rule and its
exemption:
a named constructor that returns its own type stays.

Three HTTP message collections broke the rule. Each one held a
`protected static`
validator that returns `void` or `bool`, so no exemption covers it. This
pull
request moves each validator to the home that the rule names.
`fromArray` stays
on each collection, because it returns `static`.

The three collections do not get the same treatment, because the
situations
differ.

`HeaderCollection::validateHeader()` is load-bearing. The constructor
signature
is `HeaderContract ...$headers`, so the validator converts a `mixed`
param to a
typed one before the spread. Without the validator, an invalid param
raises a
`TypeError` in place of `HttpHeaderInvalidHeaderParamException`. The
validator
moves to `HeaderFactory::assertValidHeader()`, next to the
`assertValidValue()`
and `isValidValue()` that already live there.

`ParamCollection::validateParam()` and
`UploadedFileCollection::validateFile()`
were called twice for each param. `fromArray()` called the static
validator in
its loop, and then `new static(...)` ran the constructor, which
validates every
param again through `validateParams()` / `validateFiles()`. Both calls
raise the
same exception with the same message. This pull request removes the call
in the
loop and makes each validator an instance method. Validation of the
params that
the collection holds is the behavior of its own state, so the method
belongs on
the collection.

No behavior changes. Every exception type, exception message and code
path is
the same. No existing test needed an edit: all 5152 tests passed against
the
source change before the two new tests were added.

## Types of changes

- [X] Improvement _(non-breaking change which impro... (continued)

14 of 14 new or added lines in 4 files covered. (100.0%)

12624 of 12624 relevant lines covered (100.0%)

23.76 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30719344272.1 01 Aug 2026 09:34PM UTC 1144
100.0
GitHub Action Run
Source Files on build 30719344272
  • Tree
  • List 1144
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30719344272
  • 64676e7a on github
  • Prev Build on 26.x (#30719237452)
  • Next Build on 26.x (#30719374654)
  • 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