Skip to content

Commit

Permalink
Improve doc blocks for interacting with enum inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
axlon committed Nov 21, 2024
1 parent ec6f426 commit 99306b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Http/Concerns/InteractsWithInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public function date($key, $format = null, $tz = null)
/**
* Retrieve input from the request as an enum.
*
* @template TEnum
* @template TEnum of \BackedEnum
*
* @param string $key
* @param class-string<TEnum> $enumClass
Expand All @@ -413,7 +413,7 @@ public function enum($key, $enumClass)
/**
* Retrieve input from the request as an array of enums.
*
* @template TEnum
* @template TEnum of \BackedEnum
*
* @param string $key
* @param class-string<TEnum> $enumClass
Expand Down
3 changes: 2 additions & 1 deletion types/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use function PHPStan\Testing\assertType;

class TestEnum
enum TestEnum: string
{
case Foo = 'foo';
}

$request = Request::create('/', 'GET', [
Expand Down

0 comments on commit 99306b0

Please sign in to comment.