if ($isHidden) { $definition->
addMethodCall('setHidden',
[true
]);
} if (!
$description) { if (!
$r =
$container->
getReflectionClass($class)) { throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.',
$class,
$id));
} if (!
$r->
isSubclassOf(Command::
class)) { throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".',
$id, 'console.command', Command::
class));
} $description =
str_replace('%', '%%',
$class::
getDefaultDescription() ?? ''
);
} if ($description) { $definition->
addMethodCall('setDescription',
[$description]);
$container->
register('.'.
$id.'.lazy', LazyCommand::
class) ->
setArguments([$commandName,
$aliases,
$description,
$isHidden,
new ServiceClosureArgument($lazyCommandRefs[$id])]);
$lazyCommandRefs[$id] =
new Reference('.'.
$id.'.lazy'
);
} }