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
thrownewInvalidArgumentException(sprintf('Parameter "calls" must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file));
460
460
}
461
461
462
-
foreach ($service['calls'] as$call) {
462
+
foreach ($service['calls'] as$k => $call) {
463
+
if (!\is_array($call) && (!\is_string($k) || !$callinstanceof TaggedValue)) {
464
+
thrownewInvalidArgumentException(sprintf('Invalid method call for service "%s": expected map or array, %s given in %s.', $id, $callinstanceof TaggedValue ? '!'.$call->getTag() : \gettype($call), $file));
465
+
}
466
+
467
+
if (\is_string($k)) {
468
+
thrownewInvalidArgumentException(sprintf('Invalid method call for service "%s", did you forgot a leading dash before "%s: ..." in %s?', $id, $k, $file));
if (1 === \count($call) && \is_string(key($call))) {
477
+
$method = key($call);
478
+
$args = $call[$method];
479
+
480
+
if ($argsinstanceof TaggedValue) {
481
+
if ('returns_clone' !== $args->getTag()) {
482
+
thrownewInvalidArgumentException(sprintf('Unsupported tag "!%s", did you mean "!returns_clone" for service "%s" in %s?', $args->getTag(), $id, $file));
483
+
}
484
+
485
+
$returnsClone = true;
486
+
$args = $args->getValue();
487
+
} else {
488
+
$returnsClone = false;
489
+
}
490
+
} elseif (empty($call[0])) {
491
+
thrownewInvalidArgumentException(sprintf('Invalid call for service "%s": the method must be defined as the first index of an array or as the only key of a map in %s.', $id, $file));
492
+
} else {
493
+
$method = $call[0];
494
+
$args = $call[1] ?? [];
495
+
$returnsClone = $call[2] ?? false;
496
+
}
471
497
}
472
498
473
499
if (!\is_array($args)) {
474
500
thrownewInvalidArgumentException(sprintf('The second parameter for function call "%s" must be an array of its arguments for service "%s" in %s. Check your YAML syntax.', $method, $id, $file));
0 commit comments