platform/api/symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.yaml
2024-09-02 10:44:11 -07:00

176 lines
8.4 KiB
YAML

name: ConfigDebugCommand
class_comment: null
dependencies:
- name: ConfigurationInterface
type: class
source: Symfony\Component\Config\Definition\ConfigurationInterface
- name: Processor
type: class
source: Symfony\Component\Config\Definition\Processor
- name: AsCommand
type: class
source: Symfony\Component\Console\Attribute\AsCommand
- name: CompletionInput
type: class
source: Symfony\Component\Console\Completion\CompletionInput
- name: CompletionSuggestions
type: class
source: Symfony\Component\Console\Completion\CompletionSuggestions
- name: InvalidArgumentException
type: class
source: Symfony\Component\Console\Exception\InvalidArgumentException
- name: LogicException
type: class
source: Symfony\Component\Console\Exception\LogicException
- name: InputArgument
type: class
source: Symfony\Component\Console\Input\InputArgument
- name: InputInterface
type: class
source: Symfony\Component\Console\Input\InputInterface
- name: InputOption
type: class
source: Symfony\Component\Console\Input\InputOption
- name: OutputInterface
type: class
source: Symfony\Component\Console\Output\OutputInterface
- name: SymfonyStyle
type: class
source: Symfony\Component\Console\Style\SymfonyStyle
- name: ValidateEnvPlaceholdersPass
type: class
source: Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass
- name: ContainerBuilder
type: class
source: Symfony\Component\DependencyInjection\ContainerBuilder
- name: ConfigurationExtensionInterface
type: class
source: Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface
- name: ExtensionInterface
type: class
source: Symfony\Component\DependencyInjection\Extension\ExtensionInterface
- name: Yaml
type: class
source: Symfony\Component\Yaml\Yaml
properties: []
methods:
- name: getConfigForPath
visibility: private
parameters:
- name: config
- name: path
- name: alias
comment: "# * A console command for dumping available configuration reference.\n\
# *\n# * @author Gr\xE9goire Pineau <lyrixx@lyrixx.info>\n# *\n# * @final\n# */\n\
# #[AsCommand(name: 'debug:config', description: 'Dump the current configuration\
\ for an extension')]\n# class ConfigDebugCommand extends AbstractConfigCommand\n\
# {\n# protected function configure(): void\n# {\n# $this\n# ->setDefinition([\n\
# new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension\
\ alias'),\n# new InputArgument('path', InputArgument::OPTIONAL, 'The configuration\
\ option path'),\n# new InputOption('resolve-env', null, InputOption::VALUE_NONE,\
\ 'Display resolved environment variable values instead of placeholders'),\n#\
\ new InputOption('format', null, InputOption::VALUE_REQUIRED, \\sprintf('The\
\ output format (\"%s\")', implode('\", \"', $this->getAvailableFormatOptions())),\
\ class_exists(Yaml::class) ? 'txt' : 'json'),\n# ])\n# ->setHelp(<<<EOF\n# The\
\ <info>%command.name%</info> command dumps the current configuration for an\n\
# extension/bundle.\n# \n# Either the extension alias or bundle name can be used:\n\
# \n# <info>php %command.full_name% framework</info>\n# <info>php %command.full_name%\
\ FrameworkBundle</info>\n# \n# The <info>--format</info> option specifies the\
\ format of the command output:\n# \n# <info>php %command.full_name% framework\
\ --format=json</info>\n# \n# For dumping a specific option, add its path as second\
\ argument:\n# \n# <info>php %command.full_name% framework serializer.enabled</info>\n\
# \n# EOF\n# )\n# ;\n# }\n# \n# protected function execute(InputInterface $input,\
\ OutputInterface $output): int\n# {\n# $io = new SymfonyStyle($input, $output);\n\
# $errorIo = $io->getErrorStyle();\n# \n# if (null === $name = $input->getArgument('name'))\
\ {\n# $this->listBundles($errorIo);\n# $this->listNonBundleExtensions($errorIo);\n\
# \n# $errorIo->comment('Provide the name of a bundle as the first argument of\
\ this command to dump its configuration. (e.g. <comment>debug:config FrameworkBundle</comment>)');\n\
# $errorIo->comment('For dumping a specific option, add its path as the second\
\ argument of this command. (e.g. <comment>debug:config FrameworkBundle serializer</comment>\
\ to dump the <comment>framework.serializer</comment> configuration)');\n# \n\
# return 0;\n# }\n# \n# $extension = $this->findExtension($name);\n# $extensionAlias\
\ = $extension->getAlias();\n# $container = $this->compileContainer();\n# \n#\
\ $config = $this->getConfig($extension, $container, $input->getOption('resolve-env'));\n\
# \n# $format = $input->getOption('format');\n# \n# if (\\in_array($format, ['txt',\
\ 'yml'], true) && !class_exists(Yaml::class)) {\n# $errorIo->error('Setting the\
\ \"format\" option to \"txt\" or \"yaml\" requires the Symfony Yaml component.\
\ Try running \"composer install symfony/yaml\" or use \"--format=json\" instead.');\n\
# \n# return 1;\n# }\n# \n# if (null === $path = $input->getArgument('path'))\
\ {\n# if ('txt' === $input->getOption('format')) {\n# $io->title(\n# \\sprintf('Current\
\ configuration for %s', $name === $extensionAlias ? \\sprintf('extension with\
\ alias \"%s\"', $extensionAlias) : \\sprintf('\"%s\"', $name))\n# );\n# }\n#\
\ \n# $io->writeln($this->convertToFormat([$extensionAlias => $config], $format));\n\
# \n# return 0;\n# }\n# \n# try {\n# $config = $this->getConfigForPath($config,\
\ $path, $extensionAlias);\n# } catch (LogicException $e) {\n# $errorIo->error($e->getMessage());\n\
# \n# return 1;\n# }\n# \n# $io->title(\\sprintf('Current configuration for \"\
%s.%s\"', $extensionAlias, $path));\n# \n# $io->writeln($this->convertToFormat($config,\
\ $format));\n# \n# return 0;\n# }\n# \n# private function convertToFormat(mixed\
\ $config, string $format): string\n# {\n# return match ($format) {\n# 'txt',\
\ 'yaml' => Yaml::dump($config, 10),\n# 'json' => json_encode($config, \\JSON_PRETTY_PRINT\
\ | \\JSON_UNESCAPED_SLASHES | \\JSON_UNESCAPED_UNICODE),\n# default => throw\
\ new InvalidArgumentException(\\sprintf('Supported formats are \"%s\".', implode('\"\
, \"', $this->getAvailableFormatOptions()))),\n# };\n# }\n# \n# private function\
\ compileContainer(): ContainerBuilder\n# {\n# $kernel = clone $this->getApplication()->getKernel();\n\
# $kernel->boot();\n# \n# $method = new \\ReflectionMethod($kernel, 'buildContainer');\n\
# $container = $method->invoke($kernel);\n# $container->getCompiler()->compile($container);\n\
# \n# return $container;\n# }\n# \n# /**\n# * Iterate over configuration until\
\ the last step of the given path.\n# *\n# * @throws LogicException If the configuration\
\ does not exist"
- name: getConfigForExtension
visibility: private
parameters:
- name: extension
- name: container
comment: null
- name: complete
visibility: public
parameters:
- name: input
- name: suggestions
comment: null
- name: getAvailableExtensions
visibility: private
parameters: []
comment: null
- name: getAvailableBundles
visibility: private
parameters: []
comment: null
- name: getConfig
visibility: private
parameters:
- name: extension
- name: container
- name: resolveEnvs
default: 'false'
comment: null
- name: buildPathsCompletion
visibility: private
parameters:
- name: paths
- name: prefix
default: ''''''
comment: null
- name: getAvailableFormatOptions
visibility: private
parameters: []
comment: '# @return string[]'
traits:
- Symfony\Component\Config\Definition\ConfigurationInterface
- Symfony\Component\Config\Definition\Processor
- Symfony\Component\Console\Attribute\AsCommand
- Symfony\Component\Console\Completion\CompletionInput
- Symfony\Component\Console\Completion\CompletionSuggestions
- Symfony\Component\Console\Exception\InvalidArgumentException
- Symfony\Component\Console\Exception\LogicException
- Symfony\Component\Console\Input\InputArgument
- Symfony\Component\Console\Input\InputInterface
- Symfony\Component\Console\Input\InputOption
- Symfony\Component\Console\Output\OutputInterface
- Symfony\Component\Console\Style\SymfonyStyle
- Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass
- Symfony\Component\DependencyInjection\ContainerBuilder
- Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface
- Symfony\Component\DependencyInjection\Extension\ExtensionInterface
- Symfony\Component\Yaml\Yaml
interfaces: []