Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public function setBase(string $base) : void
*/
public function addTypes(array $types) : void
{
$this->types = Arrayify::merge($this->types, $types);
$this->types = Arrayify::merge($this->types, $types);
$this->cache = [];
}
Comment on lines 104 to 108
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes a cache invalidation bug, but there’s no regression test ensuring that calling addTypes() after an initial match() (which populates the compile() cache) causes subsequent match() calls to use the updated type regex. Please add a test that primes the cache with one type definition, then overrides that type via addTypes(), and asserts that matching behavior changes accordingly.

Copilot uses AI. Check for mistakes.

/**
Expand Down