@@ -75,7 +75,7 @@ public function addDefinition(?string $name, ?Definition $definition = null): De
7575 $ name = '0 ' . $ i ; // prevents converting to integer in array key
7676
7777 } 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 ));
7979
8080 } else {
8181 $ name = $ this ->aliases [$ name ] ?? $ name ;
@@ -176,10 +176,10 @@ public function hasDefinition(string $name): bool
176176 public function addAlias (string $ alias , string $ service ): void
177177 {
178178 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 ));
180180
181181 } 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 ));
183183
184184 } elseif (isset ($ this ->aliases [$ alias ])) {
185185 throw new Nette \InvalidStateException (sprintf ("Alias '%s' has already been added. " , $ alias ));
0 commit comments