This problem was quite tricky to track.
PHPStan analyses anonymous classes using eval. When the ReflectionClass of an anonymous class is created, it retains the line on which the eval occurred, rather than the line where the class was declared. It causes the ThrowsAnnotationReader to crash when attempting to read the annotations for anonymous classes.
I'll provide a PR with a hotfix in the next few days.