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
* Applies the "container.service_locator" tag by wrapping references into ServiceClosureArgument instances.
@@ -42,15 +44,31 @@ protected function processValue($value, $isRoot = false)
42
44
43
45
$arguments = $value->getArguments();
44
46
if (!isset($arguments[0]) || !\is_array($arguments[0])) {
45
-
thrownewInvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set.', $this->currentId));
47
+
thrownewInvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references or service types is expected as first argument when the "container.service_locator" tag is set.', $this->currentId));
46
48
}
47
49
48
50
foreach ($arguments[0] as$k => $v) {
49
51
if ($vinstanceof ServiceClosureArgument) {
50
52
continue;
51
53
}
54
+
55
+
if (\is_string($type = $v) && preg_match('/^\??[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+$/', $type)) {
thrownewInvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set, "%s" found for key "%s".', $this->currentId, \is_object($v) ? \get_class($v) : \gettype($v), $k));
65
+
thrownewInvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references or service types is expected as first argument when the "container.service_locator" tag is set, "%s" found for key "%s".', $this->currentId, \is_object($v) ? \get_class($v) : \gettype($v), $k));
0 commit comments