PHP 8.1 (8.2.8 in use) provides new syntax - first class callable. Newest SonarQube 9.9 provides its support, but I get false positive php:S1144 actually.
I am using the newest version SonarQube Community Edition 9.9.1 at the moment.
public function configureContainer(Container $container): void
{
$container->bindSingleton(
SomeInterface::class,
$this->createSome(...)
);
}
private function createSome(): SomeInterface // php:S1144
{
return new Some();
}