Fix route:list crash on LINK/UNLINK verbs#1254
Merged
Merged
Conversation
…luding LINK and UNLINK Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
roxblnfk
approved these changes
May 18, 2026
There was a problem hiding this comment.
Pull request overview
Fixes route:list crashing when encountering routes restricted to the LINK/UNLINK HTTP verbs by extending verb rendering, and expands the test suite to cover route listing output formatting and verb display.
Changes:
- Extend
route:listverb rendering to handleLINKandUNLINK. - Add test-app routes for each HTTP verb so
route:listoutput can be validated reliably. - Replace the previous broad
route:listtest with multiple focused assertions around names, targets, groups, patterns, and verbs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/Framework/Command/Router/ListCommand.php |
Adds LINK/UNLINK cases to the verb-to-colored-label mapping to prevent UnhandledMatchError. |
tests/app/src/Bootloader/RoutesBootloader.php |
Registers verb-specific routes (verb-*) used to validate route:list verb rendering. |
tests/Framework/Command/Router/ListCommandTest.php |
Introduces a more granular test suite for route:list output content (names/targets/groups/patterns/verbs). |
src/Exceptions/src/Renderer/ConsoleRenderer.php |
Minor change in global function invocation within Windows color support detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| public function testAllVerbsShownAsWildcard(): void | ||
| { | ||
| $this->assertConsoleCommandOutputContainsStrings('route:list', strings: ['*']); |
| 'AuthController', | ||
| 'auth', | ||
| 'scope', | ||
| 'intercepted:without', |
Comment on lines
+49
to
+50
| 'api', | ||
| 'other', |
| try { | ||
| if (\DIRECTORY_SEPARATOR === '\\') { | ||
| return (\function_exists('sapi_windows_vt100_support') && @\sapi_windows_vt100_support($stream)) | ||
| return (\function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support($stream)) |
Prevents UnhandledMatchError if RouteInterface::VERBS gains a verb that is not enumerated in getVerbs() (the original LINK/UNLINK crash root cause). Unknown verbs now render uppercased in gray.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix for
tests/app/src/Bootloader/RoutesBootloader.php — Added 9 verb-specific routes (verb-get, verb-head, verb-options, verb-post, verb-patch, verb-put, verb-delete, verb-link, verb-unlink) using lambdas with explicit HTTP methods.
tests/Framework/Command/Router/ListCommandTest.php — Replaced the single vague testExtensions test with 16 focused tests covering: