mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
Re-dump autoloader and composer.lock
This commit is contained in:
@@ -62,7 +62,7 @@ abstract class Descriptor implements DescriptorInterface
|
||||
$object instanceof Alias => $this->describeContainerAlias($object, $options),
|
||||
$object instanceof EventDispatcherInterface => $this->describeEventDispatcherListeners($object, $options),
|
||||
\is_callable($object) => $this->describeCallable($object, $options),
|
||||
default => throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
|
||||
default => throw new \InvalidArgumentException(\sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
|
||||
};
|
||||
|
||||
if ($object instanceof ContainerBuilder) {
|
||||
@@ -133,7 +133,7 @@ abstract class Descriptor implements DescriptorInterface
|
||||
}
|
||||
|
||||
if (\is_object($value)) {
|
||||
return sprintf('object(%s)', $value::class);
|
||||
return \sprintf('object(%s)', $value::class);
|
||||
}
|
||||
|
||||
if (\is_string($value)) {
|
||||
|
||||
@@ -156,7 +156,7 @@ class JsonDescriptor extends Descriptor
|
||||
$data = [$key => $parameter];
|
||||
|
||||
if ($deprecation) {
|
||||
$data['_deprecation'] = sprintf('Since %s %s: %s', $deprecation[0], $deprecation[1], sprintf(...\array_slice($deprecation, 2)));
|
||||
$data['_deprecation'] = \sprintf('Since %s %s: %s', $deprecation[0], $deprecation[1], \sprintf(...\array_slice($deprecation, 2)));
|
||||
}
|
||||
|
||||
$this->writeData($data, $options);
|
||||
@@ -169,7 +169,7 @@ class JsonDescriptor extends Descriptor
|
||||
|
||||
protected function describeContainerDeprecations(ContainerBuilder $container, array $options = []): void
|
||||
{
|
||||
$containerDeprecationFilePath = sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
$containerDeprecationFilePath = \sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
if (!file_exists($containerDeprecationFilePath)) {
|
||||
throw new RuntimeException('The deprecation file does not exist, please try warming the cache first.');
|
||||
}
|
||||
@@ -236,7 +236,7 @@ class JsonDescriptor extends Descriptor
|
||||
$deprecations = [];
|
||||
|
||||
foreach ($deprecated as $parameter => $deprecation) {
|
||||
$deprecations[$parameter] = sprintf('Since %s %s: %s', $deprecation[0], $deprecation[1], sprintf(...\array_slice($deprecation, 2)));
|
||||
$deprecations[$parameter] = \sprintf('Since %s %s: %s', $deprecation[0], $deprecation[1], \sprintf(...\array_slice($deprecation, 2)));
|
||||
}
|
||||
|
||||
$sortedParameters['_deprecations'] = $deprecations;
|
||||
@@ -280,7 +280,7 @@ class JsonDescriptor extends Descriptor
|
||||
if ($factory[0] instanceof Reference) {
|
||||
$data['factory_service'] = (string) $factory[0];
|
||||
} elseif ($factory[0] instanceof Definition) {
|
||||
$data['factory_service'] = sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'class not configured');
|
||||
$data['factory_service'] = \sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'class not configured');
|
||||
} else {
|
||||
$data['factory_class'] = $factory[0];
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
}
|
||||
$this->describeRoute($route, ['name' => $name]);
|
||||
if (($showAliases ??= $options['show_aliases'] ?? false) && $aliases = ($reverseAliases ??= $this->getReverseAliases($routes))[$name] ?? []) {
|
||||
$this->write(sprintf("- Aliases: \n%s", implode("\n", array_map(static fn (string $alias): string => sprintf(' - %s', $alias), $aliases))));
|
||||
$this->write(\sprintf("- Aliases: \n%s", implode("\n", array_map(static fn (string $alias): string => \sprintf(' - %s', $alias), $aliases))));
|
||||
}
|
||||
}
|
||||
$this->write("\n");
|
||||
@@ -75,11 +75,11 @@ class MarkdownDescriptor extends Descriptor
|
||||
|
||||
$this->write("Container parameters\n====================\n");
|
||||
foreach ($this->sortParameters($parameters) as $key => $value) {
|
||||
$this->write(sprintf(
|
||||
$this->write(\sprintf(
|
||||
"\n- `%s`: `%s`%s",
|
||||
$key,
|
||||
$this->formatParameter($value),
|
||||
isset($deprecatedParameters[$key]) ? sprintf(' *Since %s %s: %s*', $deprecatedParameters[$key][0], $deprecatedParameters[$key][1], sprintf(...\array_slice($deprecatedParameters[$key], 2))) : ''
|
||||
isset($deprecatedParameters[$key]) ? \sprintf(' *Since %s %s: %s*', $deprecatedParameters[$key][0], $deprecatedParameters[$key][1], \sprintf(...\array_slice($deprecatedParameters[$key], 2))) : ''
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -111,13 +111,13 @@ class MarkdownDescriptor extends Descriptor
|
||||
} elseif ($service instanceof Definition) {
|
||||
$this->describeContainerDefinition($service, $childOptions, $container);
|
||||
} else {
|
||||
$this->write(sprintf('**`%s`:** `%s`', $options['id'], $service::class));
|
||||
$this->write(\sprintf('**`%s`:** `%s`', $options['id'], $service::class));
|
||||
}
|
||||
}
|
||||
|
||||
protected function describeContainerDeprecations(ContainerBuilder $container, array $options = []): void
|
||||
{
|
||||
$containerDeprecationFilePath = sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
$containerDeprecationFilePath = \sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
if (!file_exists($containerDeprecationFilePath)) {
|
||||
throw new RuntimeException('The deprecation file does not exist, please try warming the cache first.');
|
||||
}
|
||||
@@ -132,11 +132,11 @@ class MarkdownDescriptor extends Descriptor
|
||||
$formattedLogs = [];
|
||||
$remainingCount = 0;
|
||||
foreach ($logs as $log) {
|
||||
$formattedLogs[] = sprintf("- %sx: \"%s\" in %s:%s\n", $log['count'], $log['message'], $log['file'], $log['line']);
|
||||
$formattedLogs[] = \sprintf("- %sx: \"%s\" in %s:%s\n", $log['count'], $log['message'], $log['file'], $log['line']);
|
||||
$remainingCount += $log['count'];
|
||||
}
|
||||
|
||||
$this->write(sprintf("## Remaining deprecations (%s)\n\n", $remainingCount));
|
||||
$this->write(\sprintf("## Remaining deprecations (%s)\n\n", $remainingCount));
|
||||
foreach ($formattedLogs as $formattedLog) {
|
||||
$this->write($formattedLog);
|
||||
}
|
||||
@@ -201,7 +201,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
$this->write("\n\nServices\n--------\n");
|
||||
foreach ($services['services'] as $id => $service) {
|
||||
$this->write("\n");
|
||||
$this->write(sprintf('- `%s`: `%s`', $id, $service::class));
|
||||
$this->write(\sprintf('- `%s`: `%s`', $id, $service::class));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
if ($factory[0] instanceof Reference) {
|
||||
$output .= "\n".'- Factory Service: `'.$factory[0].'`';
|
||||
} elseif ($factory[0] instanceof Definition) {
|
||||
$output .= "\n".sprintf('- Factory Service: inline factory service (%s)', $factory[0]->getClass() ? sprintf('`%s`', $factory[0]->getClass()) : 'not configured');
|
||||
$output .= "\n".\sprintf('- Factory Service: inline factory service (%s)', $factory[0]->getClass() ? \sprintf('`%s`', $factory[0]->getClass()) : 'not configured');
|
||||
} else {
|
||||
$output .= "\n".'- Factory Class: `'.$factory[0].'`';
|
||||
}
|
||||
@@ -273,7 +273,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
$inEdges = null !== $container && isset($options['id']) ? $this->getServiceEdges($container, $options['id']) : [];
|
||||
$output .= "\n".'- Usages: '.($inEdges ? implode(', ', $inEdges) : 'none');
|
||||
|
||||
$this->write(isset($options['id']) ? sprintf("### %s\n\n%s\n", $options['id'], $output) : $output);
|
||||
$this->write(isset($options['id']) ? \sprintf("### %s\n\n%s\n", $options['id'], $output) : $output);
|
||||
}
|
||||
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void
|
||||
@@ -287,7 +287,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
return;
|
||||
}
|
||||
|
||||
$this->write(sprintf("### %s\n\n%s\n", $options['id'], $output));
|
||||
$this->write(\sprintf("### %s\n\n%s\n", $options['id'], $output));
|
||||
|
||||
if (!$container) {
|
||||
return;
|
||||
@@ -300,7 +300,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
protected function describeContainerParameter(mixed $parameter, ?array $deprecation, array $options = []): void
|
||||
{
|
||||
if (isset($options['parameter'])) {
|
||||
$this->write(sprintf("%s\n%s\n\n%s%s", $options['parameter'], str_repeat('=', \strlen($options['parameter'])), $this->formatParameter($parameter), $deprecation ? sprintf("\n\n*Since %s %s: %s*", $deprecation[0], $deprecation[1], sprintf(...\array_slice($deprecation, 2))) : ''));
|
||||
$this->write(\sprintf("%s\n%s\n\n%s%s", $options['parameter'], str_repeat('=', \strlen($options['parameter'])), $this->formatParameter($parameter), $deprecation ? \sprintf("\n\n*Since %s %s: %s*", $deprecation[0], $deprecation[1], \sprintf(...\array_slice($deprecation, 2))) : ''));
|
||||
} else {
|
||||
$this->write($parameter);
|
||||
}
|
||||
@@ -319,35 +319,35 @@ class MarkdownDescriptor extends Descriptor
|
||||
$title = 'Registered listeners';
|
||||
|
||||
if (null !== $dispatcherServiceName) {
|
||||
$title .= sprintf(' of event dispatcher "%s"', $dispatcherServiceName);
|
||||
$title .= \sprintf(' of event dispatcher "%s"', $dispatcherServiceName);
|
||||
}
|
||||
|
||||
if (null !== $event) {
|
||||
$title .= sprintf(' for event `%s` ordered by descending priority', $event);
|
||||
$title .= \sprintf(' for event `%s` ordered by descending priority', $event);
|
||||
$registeredListeners = $eventDispatcher->getListeners($event);
|
||||
} else {
|
||||
// Try to see if "events" exists
|
||||
$registeredListeners = \array_key_exists('events', $options) ? array_combine($options['events'], array_map(fn ($event) => $eventDispatcher->getListeners($event), $options['events'])) : $eventDispatcher->getListeners();
|
||||
}
|
||||
|
||||
$this->write(sprintf('# %s', $title)."\n");
|
||||
$this->write(\sprintf('# %s', $title)."\n");
|
||||
|
||||
if (null !== $event) {
|
||||
foreach ($registeredListeners as $order => $listener) {
|
||||
$this->write("\n".sprintf('## Listener %d', $order + 1)."\n");
|
||||
$this->write("\n".\sprintf('## Listener %d', $order + 1)."\n");
|
||||
$this->describeCallable($listener);
|
||||
$this->write(sprintf('- Priority: `%d`', $eventDispatcher->getListenerPriority($event, $listener))."\n");
|
||||
$this->write(\sprintf('- Priority: `%d`', $eventDispatcher->getListenerPriority($event, $listener))."\n");
|
||||
}
|
||||
} else {
|
||||
ksort($registeredListeners);
|
||||
|
||||
foreach ($registeredListeners as $eventListened => $eventListeners) {
|
||||
$this->write("\n".sprintf('## %s', $eventListened)."\n");
|
||||
$this->write("\n".\sprintf('## %s', $eventListened)."\n");
|
||||
|
||||
foreach ($eventListeners as $order => $eventListener) {
|
||||
$this->write("\n".sprintf('### Listener %d', $order + 1)."\n");
|
||||
$this->write("\n".\sprintf('### Listener %d', $order + 1)."\n");
|
||||
$this->describeCallable($eventListener);
|
||||
$this->write(sprintf('- Priority: `%d`', $eventDispatcher->getListenerPriority($eventListened, $eventListener))."\n");
|
||||
$this->write(\sprintf('- Priority: `%d`', $eventDispatcher->getListenerPriority($eventListened, $eventListener))."\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,16 +361,16 @@ class MarkdownDescriptor extends Descriptor
|
||||
$string .= "\n- Type: `function`";
|
||||
|
||||
if (\is_object($callable[0])) {
|
||||
$string .= "\n".sprintf('- Name: `%s`', $callable[1]);
|
||||
$string .= "\n".sprintf('- Class: `%s`', $callable[0]::class);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', $callable[1]);
|
||||
$string .= "\n".\sprintf('- Class: `%s`', $callable[0]::class);
|
||||
} else {
|
||||
if (!str_starts_with($callable[1], 'parent::')) {
|
||||
$string .= "\n".sprintf('- Name: `%s`', $callable[1]);
|
||||
$string .= "\n".sprintf('- Class: `%s`', $callable[0]);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', $callable[1]);
|
||||
$string .= "\n".\sprintf('- Class: `%s`', $callable[0]);
|
||||
$string .= "\n- Static: yes";
|
||||
} else {
|
||||
$string .= "\n".sprintf('- Name: `%s`', substr($callable[1], 8));
|
||||
$string .= "\n".sprintf('- Class: `%s`', $callable[0]);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', substr($callable[1], 8));
|
||||
$string .= "\n".\sprintf('- Class: `%s`', $callable[0]);
|
||||
$string .= "\n- Static: yes";
|
||||
$string .= "\n- Parent: yes";
|
||||
}
|
||||
@@ -385,12 +385,12 @@ class MarkdownDescriptor extends Descriptor
|
||||
$string .= "\n- Type: `function`";
|
||||
|
||||
if (!str_contains($callable, '::')) {
|
||||
$string .= "\n".sprintf('- Name: `%s`', $callable);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', $callable);
|
||||
} else {
|
||||
$callableParts = explode('::', $callable);
|
||||
|
||||
$string .= "\n".sprintf('- Name: `%s`', $callableParts[1]);
|
||||
$string .= "\n".sprintf('- Class: `%s`', $callableParts[0]);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', $callableParts[1]);
|
||||
$string .= "\n".\sprintf('- Class: `%s`', $callableParts[0]);
|
||||
$string .= "\n- Static: yes";
|
||||
}
|
||||
|
||||
@@ -408,10 +408,10 @@ class MarkdownDescriptor extends Descriptor
|
||||
|
||||
return;
|
||||
}
|
||||
$string .= "\n".sprintf('- Name: `%s`', $r->name);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', $r->name);
|
||||
|
||||
if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
|
||||
$string .= "\n".sprintf('- Class: `%s`', $class->name);
|
||||
$string .= "\n".\sprintf('- Class: `%s`', $class->name);
|
||||
if (!$r->getClosureThis()) {
|
||||
$string .= "\n- Static: yes";
|
||||
}
|
||||
@@ -424,7 +424,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
|
||||
if (method_exists($callable, '__invoke')) {
|
||||
$string .= "\n- Type: `object`";
|
||||
$string .= "\n".sprintf('- Name: `%s`', $callable::class);
|
||||
$string .= "\n".\sprintf('- Name: `%s`', $callable::class);
|
||||
|
||||
$this->write($string."\n");
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class TextDescriptor extends Descriptor
|
||||
|
||||
if (isset($deprecatedParameters[$parameter])) {
|
||||
$tableRows[] = [new TableCell(
|
||||
sprintf('<comment>(Since %s %s: %s)</comment>', $deprecatedParameters[$parameter][0], $deprecatedParameters[$parameter][1], sprintf(...\array_slice($deprecatedParameters[$parameter], 2))),
|
||||
\sprintf('<comment>(Since %s %s: %s)</comment>', $deprecatedParameters[$parameter][0], $deprecatedParameters[$parameter][1], \sprintf(...\array_slice($deprecatedParameters[$parameter], 2))),
|
||||
['colspan' => 2]
|
||||
)];
|
||||
}
|
||||
@@ -154,7 +154,7 @@ class TextDescriptor extends Descriptor
|
||||
}
|
||||
|
||||
foreach ($this->findDefinitionsByTag($container, $showHidden) as $tag => $definitions) {
|
||||
$options['output']->section(sprintf('"%s" tag', $tag));
|
||||
$options['output']->section(\sprintf('"%s" tag', $tag));
|
||||
$options['output']->listing(array_keys($definitions));
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ class TextDescriptor extends Descriptor
|
||||
} elseif ($service instanceof Definition) {
|
||||
$this->describeContainerDefinition($service, $options, $container);
|
||||
} else {
|
||||
$options['output']->title(sprintf('Information for Service "<info>%s</info>"', $options['id']));
|
||||
$options['output']->title(\sprintf('Information for Service "<info>%s</info>"', $options['id']));
|
||||
$options['output']->table(
|
||||
['Service ID', 'Class'],
|
||||
[
|
||||
@@ -192,7 +192,7 @@ class TextDescriptor extends Descriptor
|
||||
}
|
||||
|
||||
if ($showTag) {
|
||||
$title .= sprintf(' Tagged with "%s" Tag', $options['tag']);
|
||||
$title .= \sprintf(' Tagged with "%s" Tag', $options['tag']);
|
||||
}
|
||||
|
||||
$options['output']->title($title);
|
||||
@@ -249,7 +249,7 @@ class TextDescriptor extends Descriptor
|
||||
foreach ($serviceIds as $serviceId) {
|
||||
$definition = $this->resolveServiceDefinition($container, $serviceId);
|
||||
|
||||
$styledServiceId = $rawOutput ? $serviceId : sprintf('<fg=cyan>%s</fg=cyan>', OutputFormatter::escape($serviceId));
|
||||
$styledServiceId = $rawOutput ? $serviceId : \sprintf('<fg=cyan>%s</fg=cyan>', OutputFormatter::escape($serviceId));
|
||||
if ($definition instanceof Definition) {
|
||||
if ($showTag) {
|
||||
foreach ($this->sortByPriority($definition->getTag($showTag)) as $key => $tag) {
|
||||
@@ -272,7 +272,7 @@ class TextDescriptor extends Descriptor
|
||||
}
|
||||
} elseif ($definition instanceof Alias) {
|
||||
$alias = $definition;
|
||||
$tableRows[] = array_merge([$styledServiceId, sprintf('alias for "%s"', $alias)], $tagsCount ? array_fill(0, $tagsCount, '') : []);
|
||||
$tableRows[] = array_merge([$styledServiceId, \sprintf('alias for "%s"', $alias)], $tagsCount ? array_fill(0, $tagsCount, '') : []);
|
||||
} else {
|
||||
$tableRows[] = array_merge([$styledServiceId, $definition::class], $tagsCount ? array_fill(0, $tagsCount, '') : []);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ class TextDescriptor extends Descriptor
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (isset($options['id'])) {
|
||||
$options['output']->title(sprintf('Information for Service "<info>%s</info>"', $options['id']));
|
||||
$options['output']->title(\sprintf('Information for Service "<info>%s</info>"', $options['id']));
|
||||
}
|
||||
|
||||
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
|
||||
@@ -301,13 +301,13 @@ class TextDescriptor extends Descriptor
|
||||
$tagInformation = [];
|
||||
foreach ($tags as $tagName => $tagData) {
|
||||
foreach ($tagData as $tagParameters) {
|
||||
$parameters = array_map(fn ($key, $value) => sprintf('<info>%s</info>: %s', $key, \is_array($value) ? $this->formatParameter($value) : $value), array_keys($tagParameters), array_values($tagParameters));
|
||||
$parameters = array_map(fn ($key, $value) => \sprintf('<info>%s</info>: %s', $key, \is_array($value) ? $this->formatParameter($value) : $value), array_keys($tagParameters), array_values($tagParameters));
|
||||
$parameters = implode(', ', $parameters);
|
||||
|
||||
if ('' === $parameters) {
|
||||
$tagInformation[] = sprintf('%s', $tagName);
|
||||
$tagInformation[] = \sprintf('%s', $tagName);
|
||||
} else {
|
||||
$tagInformation[] = sprintf('%s (%s)', $tagName, $parameters);
|
||||
$tagInformation[] = \sprintf('%s (%s)', $tagName, $parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +343,7 @@ class TextDescriptor extends Descriptor
|
||||
if ($factory[0] instanceof Reference) {
|
||||
$tableRows[] = ['Factory Service', $factory[0]];
|
||||
} elseif ($factory[0] instanceof Definition) {
|
||||
$tableRows[] = ['Factory Service', sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'class not configured')];
|
||||
$tableRows[] = ['Factory Service', \sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'class not configured')];
|
||||
} else {
|
||||
$tableRows[] = ['Factory Class', $factory[0]];
|
||||
}
|
||||
@@ -361,27 +361,27 @@ class TextDescriptor extends Descriptor
|
||||
$argument = $argument->getValues()[0];
|
||||
}
|
||||
if ($argument instanceof Reference) {
|
||||
$argumentsInformation[] = sprintf('Service(%s)', (string) $argument);
|
||||
$argumentsInformation[] = \sprintf('Service(%s)', (string) $argument);
|
||||
} elseif ($argument instanceof IteratorArgument) {
|
||||
if ($argument instanceof TaggedIteratorArgument) {
|
||||
$argumentsInformation[] = sprintf('Tagged Iterator for "%s"%s', $argument->getTag(), $options['is_debug'] ? '' : sprintf(' (%d element(s))', \count($argument->getValues())));
|
||||
$argumentsInformation[] = \sprintf('Tagged Iterator for "%s"%s', $argument->getTag(), $options['is_debug'] ? '' : \sprintf(' (%d element(s))', \count($argument->getValues())));
|
||||
} else {
|
||||
$argumentsInformation[] = sprintf('Iterator (%d element(s))', \count($argument->getValues()));
|
||||
$argumentsInformation[] = \sprintf('Iterator (%d element(s))', \count($argument->getValues()));
|
||||
}
|
||||
|
||||
foreach ($argument->getValues() as $ref) {
|
||||
$argumentsInformation[] = sprintf('- Service(%s)', $ref);
|
||||
$argumentsInformation[] = \sprintf('- Service(%s)', $ref);
|
||||
}
|
||||
} elseif ($argument instanceof ServiceLocatorArgument) {
|
||||
$argumentsInformation[] = sprintf('Service locator (%d element(s))', \count($argument->getValues()));
|
||||
$argumentsInformation[] = \sprintf('Service locator (%d element(s))', \count($argument->getValues()));
|
||||
} elseif ($argument instanceof Definition) {
|
||||
$argumentsInformation[] = 'Inlined Service';
|
||||
} elseif ($argument instanceof \UnitEnum) {
|
||||
$argumentsInformation[] = ltrim(var_export($argument, true), '\\');
|
||||
} elseif ($argument instanceof AbstractArgument) {
|
||||
$argumentsInformation[] = sprintf('Abstract argument (%s)', $argument->getText());
|
||||
$argumentsInformation[] = \sprintf('Abstract argument (%s)', $argument->getText());
|
||||
} else {
|
||||
$argumentsInformation[] = \is_array($argument) ? sprintf('Array (%d element(s))', \count($argument)) : $argument;
|
||||
$argumentsInformation[] = \is_array($argument) ? \sprintf('Array (%d element(s))', \count($argument)) : $argument;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ class TextDescriptor extends Descriptor
|
||||
|
||||
protected function describeContainerDeprecations(ContainerBuilder $container, array $options = []): void
|
||||
{
|
||||
$containerDeprecationFilePath = sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
$containerDeprecationFilePath = \sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
if (!file_exists($containerDeprecationFilePath)) {
|
||||
$options['output']->warning('The deprecation file does not exist, please try warming the cache first.');
|
||||
|
||||
@@ -413,19 +413,19 @@ class TextDescriptor extends Descriptor
|
||||
$formattedLogs = [];
|
||||
$remainingCount = 0;
|
||||
foreach ($logs as $log) {
|
||||
$formattedLogs[] = sprintf("%sx: %s\n in %s:%s", $log['count'], $log['message'], $log['file'], $log['line']);
|
||||
$formattedLogs[] = \sprintf("%sx: %s\n in %s:%s", $log['count'], $log['message'], $log['file'], $log['line']);
|
||||
$remainingCount += $log['count'];
|
||||
}
|
||||
$options['output']->title(sprintf('Remaining deprecations (%s)', $remainingCount));
|
||||
$options['output']->title(\sprintf('Remaining deprecations (%s)', $remainingCount));
|
||||
$options['output']->listing($formattedLogs);
|
||||
}
|
||||
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if ($alias->isPublic() && !$alias->isPrivate()) {
|
||||
$options['output']->comment(sprintf('This service is a <info>public</info> alias for the service <info>%s</info>', (string) $alias));
|
||||
$options['output']->comment(\sprintf('This service is a <info>public</info> alias for the service <info>%s</info>', (string) $alias));
|
||||
} else {
|
||||
$options['output']->comment(sprintf('This service is a <comment>private</comment> alias for the service <info>%s</info>', (string) $alias));
|
||||
$options['output']->comment(\sprintf('This service is a <comment>private</comment> alias for the service <info>%s</info>', (string) $alias));
|
||||
}
|
||||
|
||||
if (!$container) {
|
||||
@@ -444,7 +444,7 @@ class TextDescriptor extends Descriptor
|
||||
|
||||
if ($deprecation) {
|
||||
$rows[] = [new TableCell(
|
||||
sprintf('<comment>(Since %s %s: %s)</comment>', $deprecation[0], $deprecation[1], sprintf(...\array_slice($deprecation, 2))),
|
||||
\sprintf('<comment>(Since %s %s: %s)</comment>', $deprecation[0], $deprecation[1], \sprintf(...\array_slice($deprecation, 2))),
|
||||
['colspan' => 2]
|
||||
)];
|
||||
}
|
||||
@@ -522,11 +522,11 @@ class TextDescriptor extends Descriptor
|
||||
$title = 'Registered Listeners';
|
||||
|
||||
if (null !== $dispatcherServiceName) {
|
||||
$title .= sprintf(' of Event Dispatcher "%s"', $dispatcherServiceName);
|
||||
$title .= \sprintf(' of Event Dispatcher "%s"', $dispatcherServiceName);
|
||||
}
|
||||
|
||||
if (null !== $event) {
|
||||
$title .= sprintf(' for "%s" Event', $event);
|
||||
$title .= \sprintf(' for "%s" Event', $event);
|
||||
$registeredListeners = $eventDispatcher->getListeners($event);
|
||||
} else {
|
||||
$title .= ' Grouped by Event';
|
||||
@@ -540,7 +540,7 @@ class TextDescriptor extends Descriptor
|
||||
} else {
|
||||
ksort($registeredListeners);
|
||||
foreach ($registeredListeners as $eventListened => $eventListeners) {
|
||||
$options['output']->section(sprintf('"%s" event', $eventListened));
|
||||
$options['output']->section(\sprintf('"%s" event', $eventListened));
|
||||
$this->renderEventListenerTable($eventDispatcher, $eventListened, $eventListeners, $options['output']);
|
||||
}
|
||||
}
|
||||
@@ -557,7 +557,7 @@ class TextDescriptor extends Descriptor
|
||||
$tableRows = [];
|
||||
|
||||
foreach ($eventListeners as $order => $listener) {
|
||||
$tableRows[] = [sprintf('#%d', $order + 1), $this->formatCallable($listener), $eventDispatcher->getListenerPriority($event, $listener)];
|
||||
$tableRows[] = [\sprintf('#%d', $order + 1), $this->formatCallable($listener), $eventDispatcher->getListenerPriority($event, $listener)];
|
||||
}
|
||||
|
||||
$io->table($tableHeaders, $tableRows);
|
||||
@@ -573,7 +573,7 @@ class TextDescriptor extends Descriptor
|
||||
|
||||
$configAsString = '';
|
||||
foreach ($config as $key => $value) {
|
||||
$configAsString .= sprintf("\n%s: %s", $key, $this->formatValue($value));
|
||||
$configAsString .= \sprintf("\n%s: %s", $key, $this->formatValue($value));
|
||||
}
|
||||
|
||||
return trim($configAsString);
|
||||
@@ -627,7 +627,7 @@ class TextDescriptor extends Descriptor
|
||||
|
||||
$fileLink = $this->fileLinkFormatter->format($r->getFileName(), $r->getStartLine());
|
||||
if ($fileLink) {
|
||||
return sprintf('<href=%s>%s</>', $fileLink, $anchorText);
|
||||
return \sprintf('<href=%s>%s</>', $fileLink, $anchorText);
|
||||
}
|
||||
|
||||
return $anchorText;
|
||||
@@ -637,14 +637,14 @@ class TextDescriptor extends Descriptor
|
||||
{
|
||||
if (\is_array($callable)) {
|
||||
if (\is_object($callable[0])) {
|
||||
return sprintf('%s::%s()', $callable[0]::class, $callable[1]);
|
||||
return \sprintf('%s::%s()', $callable[0]::class, $callable[1]);
|
||||
}
|
||||
|
||||
return sprintf('%s::%s()', $callable[0], $callable[1]);
|
||||
return \sprintf('%s::%s()', $callable[0], $callable[1]);
|
||||
}
|
||||
|
||||
if (\is_string($callable)) {
|
||||
return sprintf('%s()', $callable);
|
||||
return \sprintf('%s()', $callable);
|
||||
}
|
||||
|
||||
if ($callable instanceof \Closure) {
|
||||
@@ -653,14 +653,14 @@ class TextDescriptor extends Descriptor
|
||||
return 'Closure()';
|
||||
}
|
||||
if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
|
||||
return sprintf('%s::%s()', $class->name, $r->name);
|
||||
return \sprintf('%s::%s()', $class->name, $r->name);
|
||||
}
|
||||
|
||||
return $r->name.'()';
|
||||
}
|
||||
|
||||
if (method_exists($callable, '__invoke')) {
|
||||
return sprintf('%s::__invoke()', $callable::class);
|
||||
return \sprintf('%s::__invoke()', $callable::class);
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Callable is not describable.');
|
||||
|
||||
@@ -110,7 +110,7 @@ class XmlDescriptor extends Descriptor
|
||||
|
||||
protected function describeContainerDeprecations(ContainerBuilder $container, array $options = []): void
|
||||
{
|
||||
$containerDeprecationFilePath = sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
$containerDeprecationFilePath = \sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));
|
||||
if (!file_exists($containerDeprecationFilePath)) {
|
||||
throw new RuntimeException('The deprecation file does not exist, please try warming the cache first.');
|
||||
}
|
||||
@@ -243,7 +243,7 @@ class XmlDescriptor extends Descriptor
|
||||
$parameterXML->appendChild(new \DOMText($this->formatParameter($value)));
|
||||
|
||||
if (isset($deprecatedParameters[$key])) {
|
||||
$parameterXML->setAttribute('deprecated', sprintf('Since %s %s: %s', $deprecatedParameters[$key][0], $deprecatedParameters[$key][1], sprintf(...\array_slice($deprecatedParameters[$key], 2))));
|
||||
$parameterXML->setAttribute('deprecated', \sprintf('Since %s %s: %s', $deprecatedParameters[$key][0], $deprecatedParameters[$key][1], \sprintf(...\array_slice($deprecatedParameters[$key], 2))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ class XmlDescriptor extends Descriptor
|
||||
if ($factory[0] instanceof Reference) {
|
||||
$factoryXML->setAttribute('service', (string) $factory[0]);
|
||||
} elseif ($factory[0] instanceof Definition) {
|
||||
$factoryXML->setAttribute('service', sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'not configured'));
|
||||
$factoryXML->setAttribute('service', \sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'not configured'));
|
||||
} else {
|
||||
$factoryXML->setAttribute('class', $factory[0]);
|
||||
}
|
||||
@@ -490,7 +490,7 @@ class XmlDescriptor extends Descriptor
|
||||
$parameterXML->setAttribute('key', $options['parameter']);
|
||||
|
||||
if ($deprecation) {
|
||||
$parameterXML->setAttribute('deprecated', sprintf('Since %s %s: %s', $deprecation[0], $deprecation[1], sprintf(...\array_slice($deprecation, 2))));
|
||||
$parameterXML->setAttribute('deprecated', \sprintf('Since %s %s: %s', $deprecation[0], $deprecation[1], \sprintf(...\array_slice($deprecation, 2))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user