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
thrownewNette\InvalidArgumentException("Service '$name' must be instance of $expectedType, " . ($type ? "$type given." : 'add typehint to closure.'));
86
+
thrownewNette\InvalidArgumentException(sprintf(
87
+
"Service '%s' must be instance of %s, %s.",
88
+
$name,
89
+
$expectedType,
90
+
$type ? "$type given" : 'add typehint to closure'
91
+
));
87
92
}
88
93
89
94
if ($serviceinstanceof \Closure) {
@@ -153,7 +158,7 @@ public function getServiceType(string $name): string
153
158
return$type ? $type->getName() : '';
154
159
155
160
} else {
156
-
thrownewMissingServiceException("Service '$name' not found.");
161
+
thrownewMissingServiceException(sprintf("Service '%s' not found.", $name));
157
162
}
158
163
}
159
164
@@ -174,7 +179,7 @@ public function hasService(string $name): bool
174
179
publicfunctionisCreated(string$name): bool
175
180
{
176
181
if (!$this->hasService($name)) {
177
-
thrownewMissingServiceException("Service '$name' not found.");
182
+
thrownewMissingServiceException(sprintf("Service '%s' not found.", $name));
178
183
}
179
184
$name = $this->aliases[$name] ?? $name;
180
185
returnisset($this->instances[$name]);
@@ -195,7 +200,7 @@ public function createService(string $name, array $args = [])
195
200
thrownewNette\InvalidStateException(sprintf('Circular reference detected for services: %s.', implode(', ', array_keys($this->creating))));
196
201
197
202
} elseif ($cb === null) {
198
-
thrownewMissingServiceException("Service '$name' not found.");
203
+
thrownewMissingServiceException(sprintf("Service '%s' not found.", $name));
199
204
}
200
205
201
206
try {
@@ -209,7 +214,10 @@ public function createService(string $name, array $args = [])
209
214
}
210
215
211
216
if (!is_object($service)) {
212
-
thrownewNette\UnexpectedValueException("Unable to create service '$name', value returned by " . ($cbinstanceof \Closure ? 'closure' : "method $method()") . ' is not object.');
217
+
thrownewNette\UnexpectedValueException(sprintf(
218
+
"Unable to create service '$name', value returned by %s is not object.",
0 commit comments