Skip to content

Update parameter 3#189

Merged
alganet merged 2 commits into
Respect:masterfrom
alganet:update-parameter-3
Jun 26, 2026
Merged

Update parameter 3#189
alganet merged 2 commits into
Respect:masterfrom
alganet:update-parameter-3

Conversation

@alganet

@alganet alganet commented Jun 26, 2026

Copy link
Copy Markdown
Member

No description provided.

alganet added 2 commits June 25, 2026 21:21
respect/parameter 3.0 renamed the resolver: the contract is now the
`Resolver` interface and the PSR-11-backed implementation is
`ContainerResolver` (the static helpers `reflectCallable()` and
`acceptsType()` live on the concrete class).

- composer: require respect/parameter ^3.0 (was ^1.0)
- DispatchContext: instantiate `new ContainerResolver($this)`; keep
  `Resolver` as the interface return type of `resolver()`
- Routines (Through, When, By, AuthBasic) and Routes\Callback: call the
  static helpers via `ContainerResolver::`

Resolution behavior is unchanged: container-by-type injection does not
consume a positional slot, so type-injected params (e.g. a PSR-7
request) and positional URL params resolve identically regardless of
parameter order, exactly as with 1.0.
These issues predate the parameter migration; they surfaced when the
suite moved to PHPUnit 13, which exits non-zero on warnings/deprecations
and adds the `new.resultUnused` strict-rules check.

- AbstractRoutineTest: extend the existing phpstan ignore on the
  deliberately-invalid `new Stub(...)` line to also cover
  `new.resultUnused` (the line exists to assert the constructor throws)
- DispatchContextTest: replace deprecated `$this->any()` expectations in
  getMockForRoute() with a stub (`->method()`) for the no-args case and
  `expects($this->atLeastOnce())` for the arg-matching case, which the
  sole caller does invoke
- RouterTest: compare the magic/concrete Callback routes by their
  observable state (method, pattern, arguments) instead of whole-object
  assertEquals, avoiding the closure-comparison warning

`composer qa` is now green (phpcs, phpstan, phpunit 326 tests).
@alganet alganet merged commit 5aef0a8 into Respect:master Jun 26, 2026
3 checks passed
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.51%. Comparing base (f0be9bd) to head (f6806d7).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #189   +/-   ##
=========================================
  Coverage     98.51%   98.51%           
  Complexity      394      394           
=========================================
  Files            31       31           
  Lines          1007     1007           
=========================================
  Hits            992      992           
  Misses           15       15           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants