Skip to content

Commit 1006e16

Browse files
committed
Revert unnecessary test changes
The validation happens in ContainerFactory::create(), not in DefaultExceptionTypeResolver's constructor. Tests construct DefaultExceptionTypeResolver directly, so they are unaffected. Co-Authored-By: Claude Code
1 parent 4c17d37 commit 1006e16

6 files changed

Lines changed: 6 additions & 24 deletions

tests/PHPStan/Rules/Exceptions/ThrowsVoidFunctionWithExplicitThrowPointRuleTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use PHPUnit\Framework\Attributes\DataProvider;
8-
use ThrowsVoidFunction\DifferentException;
98
use ThrowsVoidFunction\MyException;
109

1110
/**
@@ -40,7 +39,7 @@ public static function dataRule(): array
4039
],
4140
[
4241
false,
43-
[DifferentException::class],
42+
['DifferentException'],
4443
[
4544
[
4645
'Function ThrowsVoidFunction\foo() throws exception ThrowsVoidFunction\MyException but the PHPDoc contains @throws void.',
@@ -55,7 +54,7 @@ public static function dataRule(): array
5554
],
5655
[
5756
true,
58-
[DifferentException::class],
57+
['DifferentException'],
5958
[
6059
[
6160
'Function ThrowsVoidFunction\foo() throws exception ThrowsVoidFunction\MyException but the PHPDoc contains @throws void.',

tests/PHPStan/Rules/Exceptions/ThrowsVoidMethodWithExplicitThrowPointRuleTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PHPStan\Testing\RuleTestCase;
77
use PHPUnit\Framework\Attributes\DataProvider;
88
use PHPUnit\Framework\Attributes\RequiresPhp;
9-
use ThrowsVoidMethod\DifferentException;
109
use ThrowsVoidMethod\MyException;
1110
use UnhandledMatchError;
1211
use ValueError;
@@ -43,7 +42,7 @@ public static function dataRule(): array
4342
],
4443
[
4544
false,
46-
[DifferentException::class],
45+
['DifferentException'],
4746
[
4847
[
4948
'Method ThrowsVoidMethod\Foo::doFoo() throws exception ThrowsVoidMethod\MyException but the PHPDoc contains @throws void.',
@@ -58,7 +57,7 @@ public static function dataRule(): array
5857
],
5958
[
6059
true,
61-
[DifferentException::class],
60+
['DifferentException'],
6261
[
6362
[
6463
'Method ThrowsVoidMethod\Foo::doFoo() throws exception ThrowsVoidMethod\MyException but the PHPDoc contains @throws void.',

tests/PHPStan/Rules/Exceptions/ThrowsVoidPropertyHookWithExplicitThrowPointRuleTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PHPStan\Testing\RuleTestCase;
77
use PHPUnit\Framework\Attributes\DataProvider;
88
use PHPUnit\Framework\Attributes\RequiresPhp;
9-
use ThrowsVoidPropertyHook\DifferentException;
109

1110
/**
1211
* @extends RuleTestCase<ThrowsVoidPropertyHookWithExplicitThrowPointRule>
@@ -40,7 +39,7 @@ public static function dataRule(): array
4039
],
4140
[
4241
false,
43-
[DifferentException::class],
42+
['DifferentException'],
4443
[
4544
[
4645
'Get hook for property ThrowsVoidPropertyHook\Foo::$i throws exception ThrowsVoidPropertyHook\MyException but the PHPDoc contains @throws void.',
@@ -59,7 +58,7 @@ public static function dataRule(): array
5958
],
6059
[
6160
true,
62-
[DifferentException::class],
61+
['DifferentException'],
6362
[
6463
[
6564
'Get hook for property ThrowsVoidPropertyHook\Foo::$i throws exception ThrowsVoidPropertyHook\MyException but the PHPDoc contains @throws void.',

tests/PHPStan/Rules/Exceptions/data/throws-void-function.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,3 @@ function foo(): void
1414
{
1515
throw new MyException();
1616
}
17-
18-
class DifferentException extends \Exception
19-
{
20-
21-
}

tests/PHPStan/Rules/Exceptions/data/throws-void-method.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,3 @@ public function doFoo(): void
2020

2121

2222
}
23-
24-
class DifferentException extends \Exception
25-
{
26-
27-
}

tests/PHPStan/Rules/Exceptions/data/throws-void-property-hook.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,3 @@ class Foo
2727
}
2828

2929
}
30-
31-
class DifferentException extends \Exception
32-
{
33-
34-
}

0 commit comments

Comments
 (0)