4141use ReflectionParameter ;
4242use Webmozart \Assert \Assert ;
4343
44+ use function array_key_exists ;
4445use function array_merge ;
4546use function array_slice ;
4647use function call_user_func_array ;
4748use function count ;
4849use function get_class ;
4950use function is_object ;
5051use function preg_match ;
52+ use function sprintf ;
5153use function strpos ;
5254use function trim ;
5355
@@ -164,6 +166,7 @@ public function addService(object $service, ?string $alias = null): void
164166 $ this ->serviceLocator [$ alias ?: get_class ($ service )] = $ service ;
165167 }
166168
169+ /** {@inheritDoc} */
167170 public function registerTagHandler (string $ tagName , $ handler ): void
168171 {
169172 Assert::stringNotEmpty ($ tagName );
@@ -176,6 +179,7 @@ public function registerTagHandler(string $tagName, $handler): void
176179 if (is_object ($ handler )) {
177180 Assert::implementsInterface ($ handler , TagFactory::class);
178181 $ this ->tagHandlerMappings [$ tagName ] = $ handler ;
182+
179183 return ;
180184 }
181185
@@ -217,7 +221,9 @@ private function createTag(string $body, string $name, TypeContext $context): Ta
217221 $ this ->getServiceLocatorWithDynamicParameters ($ context , $ name , $ body )
218222 );
219223
220- $ arguments ['tagLine ' ] = sprintf ('@%s %s ' , $ name , $ body );
224+ if (array_key_exists ('tagLine ' , $ arguments )) {
225+ $ arguments ['tagLine ' ] = sprintf ('@%s %s ' , $ name , $ body );
226+ }
221227
222228 try {
223229 $ callable = [$ handlerClassName , 'create ' ];
0 commit comments