is(Invader::class)) { return false; } $invaded = $classReflection->getActiveTemplateTypeMap()->getType('T') ?? throw new ShouldNotHappenException(); return $invaded->hasMethod($methodName)->yes(); } public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection { $invaded = $classReflection->getActiveTemplateTypeMap()->getType('T') ?? throw new ShouldNotHappenException(); return new InvadedMethodReflection( $invaded->getMethod($methodName, new OutOfClassScope()), ); } }