diff options
| author | Brett Parson <brett@brett-parson.com> | 2026-08-21 13:55:37 -0500 |
|---|---|---|
| committer | Brett Parson <brett@brett-parson.com> | 2026-08-21 14:00:11 -0500 |
| commit | d039a5d62a9ac6ababae70d9d96422ca59f2b2d4 (patch) | |
| tree | f0db4750a571e8040a5da02cc7190079c0d62914 /tests/Fixtures/TestRequest.php | |
| parent | 0de77a6334cee1f6e15f7e0fd35602514560be33 (diff) | |
| download | miniroute-d039a5d62a9ac6ababae70d9d96422ca59f2b2d4.tar.gz miniroute-d039a5d62a9ac6ababae70d9d96422ca59f2b2d4.zip | |
Scaffold miniroute routing/middleware kernel
Diffstat (limited to 'tests/Fixtures/TestRequest.php')
| -rw-r--r-- | tests/Fixtures/TestRequest.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/Fixtures/TestRequest.php b/tests/Fixtures/TestRequest.php new file mode 100644 index 0000000..c449610 --- /dev/null +++ b/tests/Fixtures/TestRequest.php @@ -0,0 +1,40 @@ +<?php + +declare(strict_types=1); + +namespace BrettParson\MiniRoute\Tests\Fixtures; + +use BrettParson\MiniRoute\Http\RequestInterface; + +final class TestRequest implements RequestInterface +{ + /** + * @param array<string, string> $params + */ + public function __construct( + private readonly string $method, + private readonly string $path, + private readonly array $params = [], + ) { + } + + public function method(): string + { + return $this->method; + } + + public function path(): string + { + return $this->path; + } + + public function param(string $name, string $default = ''): string + { + return $this->params[$name] ?? $default; + } + + public function withParams(array $params): RequestInterface + { + return new self($this->method, $this->path, $params); + } +} |
