getClasses() + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces() + ReflectionStubsSingleton::getReflectionStubs()->getEnums(); foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { foreach (EntitiesFilter::getFiltered( $class->methods, fn (PHPMethod $method) => $method->isReturnTypeTentative, StubProblemType::HAS_DUPLICATION, StubProblemType::FUNCTION_PARAMETER_MISMATCH, StubProblemType::WRONG_RETURN_TYPEHINT ) as $method) { yield "Method $class->name::$method->name" => [$class, $method]; } } } public static function classMethodsWithTentitiveReturnTypeProvider(): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces() + ReflectionStubsSingleton::getReflectionStubs()->getEnums(); foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { foreach (EntitiesFilter::getFiltered( $class->methods, fn (PHPMethod $method) => !$method->isReturnTypeTentative, StubProblemType::HAS_DUPLICATION, StubProblemType::FUNCTION_PARAMETER_MISMATCH, StubProblemType::WRONG_RETURN_TYPEHINT ) as $method) { yield "Method $class->name::$method->name" => [$class, $method]; } } } private static function yieldFilteredMethods(int ...$problemTypes): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces() + ReflectionStubsSingleton::getReflectionStubs()->getEnums(); foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { foreach (EntitiesFilter::getFiltered($class->methods, null, ...$problemTypes) as $method) { yield "Method $class->name::$method->name" => [$class, $method]; } } } }