PSR-12 sniff, PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword rejects new class() with: Expected 1 space after class keyword; 0 found.
However, Symfony.Objects.ObjectInstantiation.Invalid rejects new class () with: Use parentheses when instantiating classes.
It seems to me this is a bug in this sniff, because to be so satisfied, this sniff should only be concerned with the presence of parens, not the formatting thereof. Ergo it should not be attempting to enforce that the parens are adjacent to class, but currently it has that (unwanted) side-effect.