@@ -112,11 +112,6 @@ class ThrowsPhpDocRule implements Rule
112112 */
113113 private $ reportCheckedThrowsInGlobalScope ;
114114
115- /**
116- * @var bool
117- */
118- private $ ignoreDescriptiveUncheckedExceptions ;
119-
120115 /**
121116 * @var bool
122117 */
@@ -137,7 +132,6 @@ public function __construct(
137132 bool $ reportUnusedCatchesOfUncheckedExceptions ,
138133 bool $ reportUnusedCheckedThrowsInSubtypes ,
139134 bool $ reportCheckedThrowsInGlobalScope ,
140- bool $ ignoreDescriptiveUncheckedExceptions ,
141135 array $ methodWhitelist
142136 )
143137 {
@@ -149,7 +143,6 @@ public function __construct(
149143 $ this ->throwsScope = new ThrowsScope ();
150144 $ this ->reportUnusedCatchesOfUncheckedExceptions = $ reportUnusedCatchesOfUncheckedExceptions ;
151145 $ this ->reportCheckedThrowsInGlobalScope = $ reportCheckedThrowsInGlobalScope ;
152- $ this ->ignoreDescriptiveUncheckedExceptions = $ ignoreDescriptiveUncheckedExceptions ;
153146 $ this ->reportUnusedCheckedThrowsInSubtypes = $ reportUnusedCheckedThrowsInSubtypes ;
154147 $ this ->methodWhitelist = $ methodWhitelist ;
155148 }
@@ -549,8 +542,7 @@ private function processFunctionEnd(Scope $scope, int $startLine): array
549542 */
550543 private function filterUnusedExceptions (array $ declaredThrows , array $ usedThrowsAnnotations , Scope $ scope ): array
551544 {
552- $ checkedThrowsAnnotations = $ this ->checkedExceptionService ->filterCheckedExceptions ($ usedThrowsAnnotations );
553- $ unusedThrows = array_diff ($ declaredThrows , $ checkedThrowsAnnotations );
545+ $ unusedThrows = array_diff ($ declaredThrows , $ usedThrowsAnnotations );
554546
555547 $ functionReflection = $ scope ->getFunction ();
556548 if ($ functionReflection === null ) {
@@ -581,10 +573,6 @@ private function filterUnusedExceptions(array $declaredThrows, array $usedThrows
581573
582574 $ unusedThrows = array_diff ($ unusedThrows , TypeUtils::getDirectClassNames ($ defaultThrowsType ));
583575
584- if (!$ this ->ignoreDescriptiveUncheckedExceptions ) {
585- return $ unusedThrows ;
586- }
587-
588576 $ throwsAnnotations = $ this ->throwsAnnotationReader ->read ($ scope );
589577
590578 return array_filter ($ unusedThrows , static function (string $ type ) use ($ throwsAnnotations , $ usedThrowsAnnotations ): bool {
0 commit comments