private function validateFactoryServiceAndMethod($factoryServiceId, $factoryMethod)
{
if (!$factoryMethod) {
throw new MissingFactoryMethodException();
}
if (!$this->containerBuilder->has($factoryServiceId)) {
throw new ServiceNotFoundException($factoryServiceId);
}
$factoryServiceDefinition = $this->containerBuilder->findDefinition($factoryServiceId);
$factoryClass = $factoryServiceDefinition->getClass();
$this->validateFactoryClassAndMethod($factoryClass, $factoryMethod);
}