@@ -75,7 +75,7 @@ public function addDefinition(?string $name, ?Definition $definition = null): De
75
75
$ name = '0 ' . $ i ; // prevents converting to integer in array key
76
76
77
77
} elseif (is_int (key ([$ name => 1 ])) || !preg_match ('#^\w+(\.\w+)*$#D ' , $ name )) {
78
- throw new Nette \InvalidArgumentException (sprintf (' Service name must be a alpha-numeric string and not a number, %s given. ' , gettype ( $ name) ));
78
+ throw new Nette \InvalidArgumentException (sprintf (" Service name must be a alpha-numeric string and not a number, '%s' given. " , $ name ));
79
79
80
80
} else {
81
81
$ name = $ this ->aliases [$ name ] ?? $ name ;
@@ -176,10 +176,10 @@ public function hasDefinition(string $name): bool
176
176
public function addAlias (string $ alias , string $ service ): void
177
177
{
178
178
if (!$ alias ) { // builder is not ready for falsy names such as '0'
179
- throw new Nette \InvalidArgumentException (sprintf (' Alias name must be a non-empty string, %s given. ' , gettype ( $ alias) ));
179
+ throw new Nette \InvalidArgumentException (sprintf (" Alias name must be a non-empty string, '%s' given. " , $ alias ));
180
180
181
181
} elseif (!$ service ) { // builder is not ready for falsy names such as '0'
182
- throw new Nette \InvalidArgumentException (sprintf (' Service name must be a non-empty string, %s given. ' , gettype ( $ service) ));
182
+ throw new Nette \InvalidArgumentException (sprintf (" Service name must be a non-empty string, '%s' given. " , $ service ));
183
183
184
184
} elseif (isset ($ this ->aliases [$ alias ])) {
185
185
throw new Nette \InvalidStateException (sprintf ("Alias '%s' has already been added. " , $ alias ));
0 commit comments