Frameworks built on __call and facades produce hundreds of findings that are all the same false positive, and putting them in the baseline hides real errors of the same shape.
final class MacroMethodsExtension implements MethodsClassReflectionExtension
{
public function hasMethod(ClassReflection $class, string $name): bool
{
return $class->getName() === Collection::class
&& Collection::hasMacro($name);
}
// getMethod() returns a reflection describing the signature
}
The community extensions for Laravel and Symfony already do this and installing one is the right first move — writing your own is for a magic method specific to your codebase. On one project the framework extension removed 1,102 errors from the baseline, a quarter of it, and none of that was debt. Installing it before generating the baseline rather than after is what stops the file recording noise as work.