Skip to content

Commit 0d8b003

Browse files
authored
Narrow the thrown type when no exception is thrown (#352)
PHPStan 2.1.31 with bleeding edge config started reporting implicit (inherited) too-wide `@throws` type, so let's be ready for the future. https://github.com/phpstan/phpstan/releases/tag/2.1.31
2 parents 73ea667 + 3bf7701 commit 0d8b003

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Params/ParamValueAny.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
final class ParamValueAny extends ParamValue
99
{
1010

11+
/**
12+
* @throws void
13+
*/
1114
public function matches(Type $type): bool
1215
{
1316
return true;

src/Params/ParamValueExceptAny.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
final class ParamValueExceptAny extends ParamValue
99
{
1010

11+
/**
12+
* @throws void
13+
*/
1114
public function matches(Type $type): bool
1215
{
1316
return false;

0 commit comments

Comments
 (0)