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
}, Nette\InvalidStateException::class, "Service 'one' (type of Bad2): Type hint for \$bar in Bad2::create() doesn't match type hint in Bad1 constructor.");
290
+
}, Nette\InvalidStateException::class, "Service 'one' (type of Bad2): Type hint for \$bar in create() doesn't match type hint in Bad1 constructor.");
}, Nette\InvalidStateException::class, "Service 'one' (type of Bad4): Unused parameter \$baz when implementing method Bad4::create(), did you mean \$bar?");
313
+
}, Nette\InvalidStateException::class, "Service 'one' (type of Bad4): Unused parameter \$baz when implementing method create(), did you mean \$bar?");
Copy file name to clipboardExpand all lines: tests/DI/ContainerBuilder.autowiring.novalue.phpt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Assert::exception(function () {
24
24
$builder = newDI\ContainerBuilder;
25
25
$builder->addDefinition('foo')->setType('Foo');
26
26
$container = createContainer($builder);
27
-
}, Nette\DI\ServiceCreationException::class, "Service 'foo' (type of Foo): Parameter \$x in Foo::__construct() has no class type hint or default value, so its value must be specified.");
27
+
}, Nette\DI\ServiceCreationException::class, "Service 'foo' (type of Foo): Parameter \$x in __construct() has no class type hint or default value, so its value must be specified.");
28
28
29
29
30
30
class Bar
@@ -38,7 +38,7 @@ Assert::exception(function () {
38
38
$builder = newDI\ContainerBuilder;
39
39
$builder->addDefinition('foo')->setType('Bar');
40
40
$container = createContainer($builder);
41
-
}, Nette\DI\ServiceCreationException::class, "Service 'foo' (type of Bar): Parameter \$x in Bar::__construct() has no class type hint or default value, so its value must be specified.");
41
+
}, Nette\DI\ServiceCreationException::class, "Service 'foo' (type of Bar): Parameter \$x in __construct() has no class type hint or default value, so its value must be specified.");
}, Nette\InvalidStateException::class, "Service 'one' (type of Good): Class Bad8 has private constructor. (used in Good::__construct)");
149
+
}, Nette\InvalidStateException::class, "Service 'one' (type of Good): Class Bad8 has private constructor. (used in __construct())");
150
150
151
151
152
152
abstractclass Bad9
@@ -201,7 +201,7 @@ services:
201
201
b: stdClass
202
202
bad: ConstructorParam
203
203
');
204
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of ConstructorParam): Multiple services of type stdClass found: a, b (needed by \$x in ConstructorParam::__construct())");
204
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of ConstructorParam): Multiple services of type stdClass found: a, b (needed by \$x in __construct())");
205
205
206
206
207
207
// forced autowiring fail
@@ -212,7 +212,7 @@ services:
212
212
b: stdClass
213
213
bad: ConstructorParam(@\stdClass)
214
214
');
215
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of ConstructorParam): Multiple services of type stdClass found: a, b (used in ConstructorParam::__construct)");
215
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of ConstructorParam): Multiple services of type stdClass found: a, b (used in __construct())");
216
216
217
217
218
218
// autowiring fail in chain
@@ -223,7 +223,7 @@ services:
223
223
b: stdClass
224
224
bad: MethodParam()::foo()
225
225
');
226
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of MethodParam): Multiple services of type stdClass found: a, b (needed by \$x in MethodParam::foo())");
226
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of MethodParam): Multiple services of type stdClass found: a, b (needed by \$x in foo())");
227
227
228
228
229
229
// forced autowiring fail in chain
@@ -234,7 +234,7 @@ services:
234
234
b: stdClass
235
235
bad: MethodParam()::foo(@\stdClass)
236
236
');
237
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of MethodParam): Multiple services of type stdClass found: a, b (used in method foo)");
237
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of MethodParam): Multiple services of type stdClass found: a, b (used in foo())");
238
238
239
239
240
240
// autowiring fail in argument
@@ -245,7 +245,7 @@ services:
245
245
b: stdClass
246
246
bad: Good(ConstructorParam())
247
247
');
248
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (needed by \$x in ConstructorParam::__construct()) (used in Good::__construct)");
248
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (needed by \$x in ConstructorParam::__construct()) (used in __construct())");
249
249
250
250
251
251
// forced autowiring fail in argument
@@ -256,7 +256,7 @@ services:
256
256
b: stdClass
257
257
bad: Good(ConstructorParam(@\stdClass))
258
258
');
259
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in ConstructorParam::__construct)");
259
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in ConstructorParam::__construct())");
260
260
261
261
262
262
// autowiring fail in chain in argument
@@ -267,7 +267,7 @@ services:
267
267
b: stdClass
268
268
bad: Good(MethodParam()::foo())
269
269
');
270
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (needed by \$x in MethodParam::foo()) (used in Good::__construct)");
270
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (needed by \$x in MethodParam::foo()) (used in __construct())");
271
271
272
272
273
273
// forced autowiring fail in chain in argument
@@ -278,7 +278,7 @@ services:
278
278
b: stdClass
279
279
bad: Good(MethodParam()::foo(@\stdClass))
280
280
');
281
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in method foo)");
281
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in foo())");
282
282
283
283
284
284
// forced autowiring fail in property passing
@@ -306,7 +306,7 @@ services:
306
306
setup:
307
307
- $a = MethodParam()::foo(@\stdClass)
308
308
');
309
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in method foo)");
309
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in foo())");
310
310
311
311
312
312
// autowiring fail in method calling
@@ -320,7 +320,7 @@ services:
320
320
setup:
321
321
- foo
322
322
');
323
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of MethodParam): Multiple services of type stdClass found: a, b (needed by \$x in MethodParam::foo())");
323
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of MethodParam): Multiple services of type stdClass found: a, b (needed by \$x in foo())");
324
324
325
325
326
326
// forced autowiring fail in method calling
@@ -334,7 +334,7 @@ services:
334
334
setup:
335
335
- bar(@\stdClass)
336
336
');
337
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in @bad::bar)");
337
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in @bad::bar())");
338
338
339
339
340
340
// autowiring fail in rich method calling
@@ -348,4 +348,4 @@ services:
348
348
setup:
349
349
- bar(MethodParam()::foo(@\stdClass))
350
350
');
351
-
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in method foo)");
351
+
}, Nette\DI\ServiceCreationException::class, "Service 'bad' (type of Good): Multiple services of type stdClass found: a, b (used in foo())");
0 commit comments