The method getServiceIds() does not exist on Symfony\Component\Depend...tion\ContainerInterface. It seems like you code against a sub-type of Symfony\Component\Depend...tion\ContainerInterface such as Symfony\Component\DependencyInjection\Container or Symfony\Component\Depend...ection\ContainerBuilder.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
24
foreach ($this->getContainer()->/** @scrutinizer ignore-call */ getServiceIds() as $id) {