Skip to content

Commit af6d594

Browse files
Remove failing cases
1 parent 98b340b commit af6d594

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4297,10 +4297,6 @@ private function getConstructorThrowPoint(MethodReflection $constructorReflectio
42974297
if ($constructorReflection->getThrowType() !== null) {
42984298
$throwType = $constructorReflection->getThrowType();
42994299
if (!$throwType->isVoid()->yes()) {
4300-
if ($throwType instanceof StaticType && $this->reflectionProvider->hasClass($className->name)) {
4301-
$throwType = $throwType->changeBaseClass($this->reflectionProvider->getClass($className->name));
4302-
}
4303-
43044300
return ThrowPoint::createExplicit($scope, $throwType, $new, true);
43054301
}
43064302
} elseif ($this->implicitThrows) {
@@ -4413,18 +4409,6 @@ private function getThrowPointsFromPropertyHook(
44134409

44144410
if ($throwType !== null) {
44154411
if (!$throwType->isVoid()->yes()) {
4416-
if ($throwType instanceof StaticType) {
4417-
$classReflections = $scope->getType($propertyFetch->var)->getObjectClassReflections();
4418-
if (count($classReflections) > 0) {
4419-
$types = [];
4420-
foreach ($classReflections as $classReflection) {
4421-
$types[] = $throwType->changeBaseClass($classReflection);
4422-
}
4423-
4424-
$throwType = TypeCombinator::union(...$types);
4425-
}
4426-
}
4427-
44284412
return [ThrowPoint::createExplicit($scope, $throwType, $propertyFetch, true)];
44294413
}
44304414
} elseif ($this->implicitThrows) {

tests/PHPStan/Rules/Exceptions/data/bug-11900.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,4 @@ public function validate2(): void
6868
{
6969
TestDataException::throw2();
7070
}
71-
72-
/**
73-
* @throws TestDataException
74-
*/
75-
public function validate3(TestDataException $e): void
76-
{
77-
$e->i;
78-
}
79-
80-
/**
81-
* @throws TestDataException
82-
*/
83-
public function validate4(): void
84-
{
85-
new TestDataException();
86-
}
8771
}

0 commit comments

Comments
 (0)