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
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -42,18 +42,20 @@ protected function processValue($value, $isRoot = false)
42
42
foreach ($value->getArguments() as$k => $v) {
43
43
if ($k !== $i++) {
44
44
if (!is_int($k)) {
45
-
$value->addError(sprintf('Invalid constructor argument for service "%s": integer expected but found string "%s". Check your service definition.', $this->currentId, $k));
45
+
$msg = sprintf('Invalid constructor argument for service "%s": integer expected but found string "%s". Check your service definition.', $this->currentId, $k);
46
+
$value->addError($msg);
46
47
47
48
if ($this->throwExceptions) {
48
-
thrownewRuntimeException(sprintf('Invalid constructor argument for service "%s": integer expected but found string "%s". Check your service definition.', $this->currentId, $k));
49
+
thrownewRuntimeException($msg);
49
50
}
50
51
51
52
break;
52
53
}
53
54
54
-
$value->addError(sprintf('Invalid constructor argument %d for service "%s": argument %d must be defined before. Check your service definition.', 1 + $k, $this->currentId, $i));
55
+
$msg = sprintf('Invalid constructor argument %d for service "%s": argument %d must be defined before. Check your service definition.', 1 + $k, $this->currentId, $i);
56
+
$value->addError($msg);
55
57
if ($this->throwExceptions) {
56
-
thrownewRuntimeException(sprintf('Invalid constructor argument %d for service "%s": argument %d must be defined before. Check your service definition.', 1 + $k, $this->currentId, $i));
58
+
thrownewRuntimeException($msg);
57
59
}
58
60
}
59
61
}
@@ -63,17 +65,20 @@ protected function processValue($value, $isRoot = false)
63
65
foreach ($methodCall[1] as$k => $v) {
64
66
if ($k !== $i++) {
65
67
if (!is_int($k)) {
66
-
$value->addError(sprintf('Invalid argument for method call "%s" of service "%s": integer expected but found string "%s". Check your service definition.', $methodCall[0], $this->currentId, $k));
68
+
$msg = sprintf('Invalid argument for method call "%s" of service "%s": integer expected but found string "%s". Check your service definition.', $methodCall[0], $this->currentId, $k);
69
+
$value->addError($msg);
70
+
67
71
if ($this->throwExceptions) {
68
-
thrownewRuntimeException(sprintf('Invalid argument for method call "%s" of service "%s": integer expected but found string "%s". Check your service definition.', $methodCall[0], $this->currentId, $k));
72
+
thrownewRuntimeException($msg);
69
73
}
70
74
71
75
break;
72
76
}
73
77
74
-
$value->addError(sprintf('Invalid argument %d for method call "%s" of service "%s": argument %d must be defined before. Check your service definition.', 1 + $k, $methodCall[0], $this->currentId, $i));
78
+
$msg = sprintf('Invalid argument %d for method call "%s" of service "%s": argument %d must be defined before. Check your service definition.', 1 + $k, $methodCall[0], $this->currentId, $i);
79
+
$value->addError($msg);
75
80
if ($this->throwExceptions) {
76
-
thrownewRuntimeException(sprintf('Invalid argument %d for method call "%s" of service "%s": argument %d must be defined before. Check your service definition.', 1 + $k, $methodCall[0], $this->currentId, $i));
0 commit comments