Skip to content

Commit 67ee8ec

Browse files
committed
exception messages: register -> add
1 parent 6495c95 commit 67ee8ec

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/DI/Extensions/InjectExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static function checkType($class, string $name, ?string $type, $containe
154154
} elseif (!class_exists($type) && !interface_exists($type)) {
155155
throw new Nette\InvalidStateException("Class or interface '$type' used in @var annotation at $propName not found. Check annotation and 'use' statements.");
156156
} elseif ($container && !$container->getByType($type, false)) {
157-
throw new Nette\DI\MissingServiceException("Service of type $type used in @var annotation at $propName not found. Did you register it in configuration file?");
157+
throw new Nette\DI\MissingServiceException("Service of type $type used in @var annotation at $propName not found. Did you add it to configuration file?");
158158
}
159159
}
160160
}

src/DI/Resolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ private static function autowireArgument(\ReflectionParameter $parameter, callab
540540
if ($res !== null || $parameter->allowsNull()) {
541541
return $res;
542542
} elseif (class_exists($type) || interface_exists($type)) {
543-
throw new ServiceCreationException("Service of type $type needed by $desc not found. Did you register it in configuration file?");
543+
throw new ServiceCreationException("Service of type $type needed by $desc not found. Did you add it to configuration file?");
544544
} else {
545545
throw new ServiceCreationException("Class $type needed by $desc not found. Check type hint and 'use' statements.");
546546
}

tests/DI/ContainerBuilder.selfdependency.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ $builder->addDefinition(null)
2727

2828
Assert::exception(function () use ($builder) {
2929
createContainer($builder);
30-
}, Nette\DI\ServiceCreationException::class, 'Service of type Foo: Service of type Foo needed by $foo in __construct() not found. Did you register it in configuration file?');
30+
}, Nette\DI\ServiceCreationException::class, 'Service of type Foo: Service of type Foo needed by $foo in __construct() not found. Did you add it to configuration file?');

tests/DI/InjectExtension.errors.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ services:
4646
factory: ServiceA
4747
inject: yes
4848
');
49-
}, InvalidStateException::class, 'Service of type DateTimeImmutable used in @var annotation at ServiceA::$a not found. Did you register it in configuration file?');
49+
}, InvalidStateException::class, 'Service of type DateTimeImmutable used in @var annotation at ServiceA::$a not found. Did you add it to configuration file?');
5050

5151

5252
Assert::exception(function () use ($compiler) {

tests/DI/Resolver.autowireArguments.errors.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require __DIR__ . '/../bootstrap.php';
1515

1616
Assert::exception(function () {
1717
Resolver::autowireArguments(new ReflectionFunction(function (stdClass $x) {}), [], function () {});
18-
}, Nette\DI\ServiceCreationException::class, 'Service of type stdClass needed by $x in {closure}() not found. Did you register it in configuration file?');
18+
}, Nette\DI\ServiceCreationException::class, 'Service of type stdClass needed by $x in {closure}() not found. Did you add it to configuration file?');
1919

2020

2121
Assert::exception(function () {

0 commit comments

Comments
 (0)