Feature request
The ReflectionClassConstructorThrowTypeExtension only check for constantString
So
new \ReflectionClass(Foo::class);
is not throwing an exception.
But
new \ReflectionClass(new Foo());
does.
The Extension is doing
foreach (TypeUtils::getConstantStrings($valueType) as $constantString) {
if (!$this->reflectionProvider->hasClass($constantString->getValue())) {
return $methodReflection->getThrowType();
}
$valueType = TypeCombinator::remove($valueType, $constantString);
}
checking for Bar::class|Foo::class|...
What would be the equivalent way to check for Bar|Foo|... @ondrejmirtes ? I can do the PR.