You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewAutowiringFailedException($this->currentId, sprintf('Cannot autowire service "%s": argument "$%s" of method "%s()" %s, you should configure its value explicitly.', $this->currentId, $parameter->name, $class !== $this->currentId ? $class.'::'.$method : $method, $type));
* ContainerBuilder is a DI container that provides an API to easily describe services.
@@ -1040,10 +1039,6 @@ private function createService(Definition $definition, array &$inlineServices, b
1040
1039
if (null !== $factory) {
1041
1040
$service = $factory(...$arguments);
1042
1041
1043
-
if (\is_object($tryProxy) && \get_class($service) !== $parameterBag->resolveValue($definition->getClass())) {
1044
-
thrownewLogicException(sprintf('Lazy service of type "%s" cannot be hydrated because its factory returned an unexpected instance of "%s". Try adding the "proxy" tag to the corresponding service definition with attribute "interface" set to "%1$s".', $definition->getClass(), get_debug_type($service)));
1045
-
}
1046
-
1047
1042
if (!$definition->isDeprecated() && \is_array($factory) && \is_string($factory[0])) {
1048
1043
$r = new \ReflectionClass($factory[0]);
1049
1044
@@ -1113,10 +1108,6 @@ private function createService(Definition $definition, array &$inlineServices, b
1113
1108
$callable($service);
1114
1109
}
1115
1110
1116
-
if (\is_object($tryProxy) && $tryProxy !== $service) {
@@ -1329,19 +1320,6 @@ protected function createProxy(\$class, \Closure \$factory)
1329
1320
{$proxyLoader}return \$factory();
1330
1321
}
1331
1322
1332
-
protected function hydrateProxy(\$proxy, \$instance)
1333
-
{
1334
-
if (\$proxy === \$instance) {
1335
-
return \$proxy;
1336
-
}
1337
-
1338
-
if (!\in_array(\get_class(\$instance), [\get_class(\$proxy), get_parent_class(\$proxy)], true)) {
1339
-
throw new LogicException(sprintf('Lazy service of type "%s" cannot be hydrated because its factory returned an unexpected instance of "%s". Try adding the "proxy" tag to the corresponding service definition with attribute "interface" set to "%1\$s".', get_parent_class(\$proxy), get_debug_type(\$instance)));
0 commit comments