- // synthetic service has non-prototype scope
- if ($definition->isSynthetic() && ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope(false)) {
- throw new RuntimeException(sprintf('A synthetic service ("%s") cannot be of scope "prototype".', $id));
- }
-
- // shared service has non-prototype scope
- if ($definition->isShared() && ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope(false)) {
- throw new RuntimeException(sprintf('A shared service ("%s") cannot be of scope "prototype".', $id));
- }
-
- if ($definition->getFactory() && ($definition->getFactoryClass(false) || $definition->getFactoryService(false) || $definition->getFactoryMethod(false))) {
- throw new RuntimeException(sprintf('A service ("%s") can use either the old or the new factory syntax, not both.', $id));
- }
-