diff --git a/src/DI/Extensions/InjectExtension.php b/src/DI/Extensions/InjectExtension.php index dad04e1ad..514abff05 100644 --- a/src/DI/Extensions/InjectExtension.php +++ b/src/DI/Extensions/InjectExtension.php @@ -154,7 +154,7 @@ private static function checkType($class, string $name, ?string $type, $containe } elseif (!class_exists($type) && !interface_exists($type)) { throw new Nette\InvalidStateException("Class or interface '$type' used in @var annotation at $propName not found. Check annotation and 'use' statements."); } elseif ($container && !$container->getByType($type, false)) { - throw new Nette\DI\MissingServiceException("Service of type $type used in @var annotation at $propName not found. Did you register it in configuration file?"); + throw new Nette\DI\MissingServiceException("Service of type $type used in @var annotation at $propName not found. Did you add it in configuration file?"); } } } diff --git a/src/DI/Resolver.php b/src/DI/Resolver.php index 09e8c6da5..58a09073a 100644 --- a/src/DI/Resolver.php +++ b/src/DI/Resolver.php @@ -540,7 +540,7 @@ private static function autowireArgument(\ReflectionParameter $parameter, callab if ($res !== null || $parameter->allowsNull()) { return $res; } elseif (class_exists($type) || interface_exists($type)) { - throw new ServiceCreationException("Service of type $type needed by $desc not found. Did you register it in configuration file?"); + throw new ServiceCreationException("Service of type $type needed by $desc not found. Did you add it in configuration file?"); } else { throw new ServiceCreationException("Class $type needed by $desc not found. Check type hint and 'use' statements."); } diff --git a/tests/DI/ContainerBuilder.selfdependency.phpt b/tests/DI/ContainerBuilder.selfdependency.phpt index fec0fcc27..94b81b4d1 100644 --- a/tests/DI/ContainerBuilder.selfdependency.phpt +++ b/tests/DI/ContainerBuilder.selfdependency.phpt @@ -27,4 +27,4 @@ $builder->addDefinition(null) Assert::exception(function () use ($builder) { createContainer($builder); -}, 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?'); +}, Nette\DI\ServiceCreationException::class, 'Service of type Foo: Service of type Foo needed by $foo in __construct() not found. Did you add it in configuration file?'); diff --git a/tests/DI/InjectExtension.errors.phpt b/tests/DI/InjectExtension.errors.phpt index 1e96105cb..d3b43da0a 100644 --- a/tests/DI/InjectExtension.errors.phpt +++ b/tests/DI/InjectExtension.errors.phpt @@ -46,7 +46,7 @@ services: factory: ServiceA inject: yes '); -}, InvalidStateException::class, 'Service of type DateTimeImmutable used in @var annotation at ServiceA::$a not found. Did you register it in configuration file?'); +}, InvalidStateException::class, 'Service of type DateTimeImmutable used in @var annotation at ServiceA::$a not found. Did you add it in configuration file?'); Assert::exception(function () use ($compiler) { diff --git a/tests/DI/Resolver.autowireArguments.errors.phpt b/tests/DI/Resolver.autowireArguments.errors.phpt index 1827031c8..a4e1343ca 100644 --- a/tests/DI/Resolver.autowireArguments.errors.phpt +++ b/tests/DI/Resolver.autowireArguments.errors.phpt @@ -15,7 +15,7 @@ require __DIR__ . '/../bootstrap.php'; Assert::exception(function () { Resolver::autowireArguments(new ReflectionFunction(function (stdClass $x) {}), [], function () {}); -}, Nette\DI\ServiceCreationException::class, 'Service of type stdClass needed by $x in {closure}() not found. Did you register it in configuration file?'); +}, Nette\DI\ServiceCreationException::class, 'Service of type stdClass needed by $x in {closure}() not found. Did you add it in configuration file?'); Assert::exception(function () {