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.
@@ -291,7 +290,7 @@ public function addObjectResource(object|string $object): static
291
290
{
292
291
if ($this->trackResources) {
293
292
if (\is_object($object)) {
294
-
$object = \get_class($object);
293
+
$object = $object::class;
295
294
}
296
295
if (!isset($this->classReflectors[$object])) {
297
296
$this->classReflectors[$object] = new \ReflectionClass($object);
@@ -1037,10 +1036,6 @@ private function createService(Definition $definition, array &$inlineServices, b
1037
1036
if (null !== $factory) {
1038
1037
$service = $factory(...$arguments);
1039
1038
1040
-
if (\is_object($tryProxy) && \get_class($service) !== $parameterBag->resolveValue($definition->getClass())) {
1041
-
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)));
1042
-
}
1043
-
1044
1039
if (!$definition->isDeprecated() && \is_array($factory) && \is_string($factory[0])) {
1045
1040
$r = new \ReflectionClass($factory[0]);
1046
1041
@@ -1110,10 +1105,6 @@ private function createService(Definition $definition, array &$inlineServices, b
1110
1105
$callable($service);
1111
1106
}
1112
1107
1113
-
if (\is_object($tryProxy) && $tryProxy !== $service) {
@@ -1326,19 +1317,6 @@ protected function createProxy(\$class, \Closure \$factory)
1326
1317
{$proxyLoader}return \$factory();
1327
1318
}
1328
1319
1329
-
protected function hydrateProxy(\$proxy, \$instance)
1330
-
{
1331
-
if (\$proxy === \$instance) {
1332
-
return \$proxy;
1333
-
}
1334
-
1335
-
if (!\in_array(\get_class(\$instance), [\get_class(\$proxy), get_parent_class(\$proxy)], true)) {
1336
-
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)));
@@ -1665,7 +1643,7 @@ private function exportParameters(array $parameters, string $path = '', int $ind
1665
1643
thrownewInvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
0 commit comments