@@ -112,11 +112,6 @@ class ThrowsPhpDocRule implements Rule
112
112
*/
113
113
private $ reportCheckedThrowsInGlobalScope ;
114
114
115
- /**
116
- * @var bool
117
- */
118
- private $ ignoreDescriptiveUncheckedExceptions ;
119
-
120
115
/**
121
116
* @var bool
122
117
*/
@@ -137,7 +132,6 @@ public function __construct(
137
132
bool $ reportUnusedCatchesOfUncheckedExceptions ,
138
133
bool $ reportUnusedCheckedThrowsInSubtypes ,
139
134
bool $ reportCheckedThrowsInGlobalScope ,
140
- bool $ ignoreDescriptiveUncheckedExceptions ,
141
135
array $ methodWhitelist
142
136
)
143
137
{
@@ -149,7 +143,6 @@ public function __construct(
149
143
$ this ->throwsScope = new ThrowsScope ();
150
144
$ this ->reportUnusedCatchesOfUncheckedExceptions = $ reportUnusedCatchesOfUncheckedExceptions ;
151
145
$ this ->reportCheckedThrowsInGlobalScope = $ reportCheckedThrowsInGlobalScope ;
152
- $ this ->ignoreDescriptiveUncheckedExceptions = $ ignoreDescriptiveUncheckedExceptions ;
153
146
$ this ->reportUnusedCheckedThrowsInSubtypes = $ reportUnusedCheckedThrowsInSubtypes ;
154
147
$ this ->methodWhitelist = $ methodWhitelist ;
155
148
}
@@ -549,8 +542,7 @@ private function processFunctionEnd(Scope $scope, int $startLine): array
549
542
*/
550
543
private function filterUnusedExceptions (array $ declaredThrows , array $ usedThrowsAnnotations , Scope $ scope ): array
551
544
{
552
- $ checkedThrowsAnnotations = $ this ->checkedExceptionService ->filterCheckedExceptions ($ usedThrowsAnnotations );
553
- $ unusedThrows = array_diff ($ declaredThrows , $ checkedThrowsAnnotations );
545
+ $ unusedThrows = array_diff ($ declaredThrows , $ usedThrowsAnnotations );
554
546
555
547
$ functionReflection = $ scope ->getFunction ();
556
548
if ($ functionReflection === null ) {
@@ -581,10 +573,6 @@ private function filterUnusedExceptions(array $declaredThrows, array $usedThrows
581
573
582
574
$ unusedThrows = array_diff ($ unusedThrows , TypeUtils::getDirectClassNames ($ defaultThrowsType ));
583
575
584
- if (!$ this ->ignoreDescriptiveUncheckedExceptions ) {
585
- return $ unusedThrows ;
586
- }
587
-
588
576
$ throwsAnnotations = $ this ->throwsAnnotationReader ->read ($ scope );
589
577
590
578
return array_filter ($ unusedThrows , static function (string $ type ) use ($ throwsAnnotations , $ usedThrowsAnnotations ): bool {
0 commit comments