X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fdependency-injection%2FCompiler%2FCheckDefinitionValidityPass.php;fp=vendor%2Fsymfony%2Fdependency-injection%2FCompiler%2FCheckDefinitionValidityPass.php;h=0d21ef284425204fc7ed4a96877015bb2d5db97d;hp=e54ee60abbcaf1c2e3eb6f0d9c1541fb27d31cc3;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/dependency-injection/Compiler/CheckDefinitionValidityPass.php b/vendor/symfony/dependency-injection/Compiler/CheckDefinitionValidityPass.php index e54ee60ab..0d21ef284 100644 --- a/vendor/symfony/dependency-injection/Compiler/CheckDefinitionValidityPass.php +++ b/vendor/symfony/dependency-injection/Compiler/CheckDefinitionValidityPass.php @@ -11,7 +11,6 @@ namespace Symfony\Component\DependencyInjection\Compiler; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\RuntimeException; @@ -24,8 +23,6 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException; * * - non synthetic, non abstract services always have a class set * - synthetic services are always public - * - synthetic services are always of non-prototype scope - * - shared services are always of non-prototype scope * * @author Johannes M. Schmitt */ @@ -46,23 +43,9 @@ class CheckDefinitionValidityPass implements CompilerPassInterface throw new RuntimeException(sprintf('A synthetic service ("%s") must be public.', $id)); } - // 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)); - } - // non-synthetic, non-abstract service has class if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) { - if ($definition->getFactory() || $definition->getFactoryClass(false) || $definition->getFactoryService(false)) { + if ($definition->getFactory()) { throw new RuntimeException(sprintf('Please add the class to service "%s" even if it is constructed by a factory since we might need to add method calls based on compile-time checks.', $id)); }