Skip to content

Add configurable QR code route priority without changing defaults - #96

Merged
endroid merged 1 commit into
mainfrom
fix/route-priority
Oct 13, 2026
Merged

endroid merged 1 commit into
mainfrom
fix/route-priority

Conversation

@endroid

@endroid endroid commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #95 by adding an optional integer route_priority, defaulting to 0. Applications whose catch-all route intercepts QR URLs can set it to 1 (or above their catch-all priority).

The default keeps existing precedence unchanged. The loader constructor remains compatible with two arguments, and explicitly defined qr_code_generate routes remain untouched. No YAML route resource, dependency, or routing redesign is introduced.

Verification

  • Regression test fails against the original loader: the catch-all matches instead of qr_code_generate.
  • vendor/bin/unit-test: 6 tests, 12 assertions with highest and lowest dependencies.
  • vendor/bin/functional-test and vendor/bin/functional-test 6.4: each 4 tests, 14 assertions, including real QR responses despite an earlier catch-all in the test application.
  • vendor/bin/code-quality: formatter, linter, and static analysis pass.

The lowest-dependency unit run reports two PHP 8.4 implicit-nullability deprecations from Symfony Config 6.4.0; all assertions pass. No dependency deprecations were suppressed or changed.

Preserve existing route precedence by default while allowing applications to place the QR code route ahead of catch-all routes. Keep explicit routes and two-argument loader construction unchanged.

Fixes #95

Amp-Thread-ID: https://ampcode.com/threads/T-01a135b3-5c83-75eb-aef1-0c8b4f44f342
Co-authored-by: Jeroen van den Enden <jeroenvandenenden@gmail.com>
@endroid
endroid merged commit 0b7ef7a into main Oct 13, 2026
4 checks passed
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.

Router order issue with v7

2 participants