getAvailableFormatOptions example


#[AsCommand(name: 'config:dump-reference', description: 'Dump the default configuration for an extension')] class ConfigDumpReferenceCommand extends AbstractConfigCommand
{
    protected function configure(): void
    {
        $commentedHelpFormats = array_map(fn ($format) => sprintf('<comment>%s</comment>', $format)$this->getAvailableFormatOptions());
        $helpFormats = implode('", "', $commentedHelpFormats);

        $this
            ->setDefinition([
                new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle name or the extension alias'),
                new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'yaml'),
            ])
            ->setHelp(<<<EOF The <info>%command.name%</info> command dumps the default configuration for an extension/bundle. Either the extension alias or bundle name can be used: <info>php %command.full_name% framework</info> <info>php %command.full_name% FrameworkBundle</info> The <info>--format</info> option specifies the format of the configuration, these are "
private array $namePatterns = ['*.twig'],
    ) {
        parent::__construct();
    }

    /** * @return void */
    protected function configure()
    {
        $this
            ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
            ->addOption('show-deprecations', null, InputOption::VALUE_NONE, 'Show deprecations as errors')
            ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command lints a template and outputs to STDOUT the first encountered syntax error. You can validate the syntax of contents passed from STDIN: <info>cat filename | php %command.full_name% -</info> Or the syntax of a file: <info>php %command.full_name% filename</info> Or of a whole directory: <info>php %command.full_name% dirname</info> <info>php %command.full_name% dirname --format=json</info>
protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputOption('time-based', null, InputOption::VALUE_REQUIRED, 'The timestamp, to generate a time-based UUID: a parsable date/time string'),
                new InputOption('node', null, InputOption::VALUE_REQUIRED, 'The UUID whose node part should be used as the node of the generated UUID'),
                new InputOption('name-based', null, InputOption::VALUE_REQUIRED, 'The name, to generate a name-based UUID'),
                new InputOption('namespace', null, InputOption::VALUE_REQUIRED, 'The UUID to use at the namespace for named-based UUIDs, predefined namespaces keywords "dns", "url", "oid" and "x500" are accepted'),
                new InputOption('random-based', null, InputOption::VALUE_NONE, 'To generate a random-based UUID'),
                new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of UUID to generate', 1),
                new InputOption('format', 'f', InputOption::VALUE_REQUIRED, sprintf('The UUID output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'rfc4122'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> generates a UUID. <info>php %command.full_name%</info> To generate a time-based UUID: <info>php %command.full_name% --time-based=now</info> To specify a time-based UUID's node: <info>php %command.full_name% --time-based=@1613480254 --node=fb3502dc-137e-4849-8886-ac90d07f64a7</info> To generate a name-based UUID: <info>php %command.full_name% --name-based=foo</info> To specify a name-based UUID's namespace: <info>php %command.full_name% --name-based=bar --namespace=fb3502dc-137e-4849-8886-ac90d07f64a7</info> To generate a random-based UUID: <info>php %command.full_name% --random-based</info> To generate several UUIDs: <info>php %command.full_name% --count=10</info> To output a specific format: <info>php %command.full_name% --format=base58</info>
->setDefinition([
                new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
                new InputOption('show-arguments', null, InputOption::VALUE_NONE, 'Show arguments in services'),
                new InputOption('show-hidden', null, InputOption::VALUE_NONE, 'Show hidden (internal) services'),
                new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Show all services with a specific tag'),
                new InputOption('tags', null, InputOption::VALUE_NONE, 'Display tagged services for an application'),
                new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Display a specific parameter for an application'),
                new InputOption('parameters', null, InputOption::VALUE_NONE, 'Display parameters for an application'),
                new InputOption('types', null, InputOption::VALUE_NONE, 'Display types (classes/interfaces) available in the container'),
                new InputOption('env-var', null, InputOption::VALUE_REQUIRED, 'Display a specific environment variable used in the container'),
                new InputOption('env-vars', null, InputOption::VALUE_NONE, 'Display environment variables used in the container'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
                new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'),
                new InputOption('deprecations', null, InputOption::VALUE_NONE, 'Display deprecations generated when compiling and warming up the container'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command displays all configured <comment>public</comment> services: <info>php %command.full_name%</info> To see deprecations generated during container compilation and cache warmup, use the <info>--deprecations</info> option: <info>php %command.full_name% --deprecations</info> To get specific information about a service, specify its name: <info>php %command.full_name% validator</info> To get specific information about a service including all its arguments, use the <info>--show-arguments</info> flag: <info>php %command.full_name% validator --show-arguments</info> To see available types that can be used for autowiring, use the <info>--types</info> flag: <info>php %command.full_name% --types</info> To see environment variables used by the container, use the <info>--env-vars</info> flag: <info>php %command.full_name% --env-vars</info> Display a specific environment variable by specifying its name with the <info>--env-var</info> option: <info>php %command.full_name% --env-var=APP_ENV</info> Use the --tags option to display tagged <comment>public</comment> services grouped by tag: <info>php %command.full_name% --tags</info> Find all services with a specific tag by specifying the tag name with the <info>--tag</info> option: <info>php %command.full_name% --tag=form.type</info> Use the <info>--parameters</info> option to display all parameters: <info>php %command.full_name% --parameters</info> Display a specific parameter by specifying its name with the <info>--parameter</info> option: <info>php %command.full_name% --parameter=kernel.debug</info> By default, internal services are hidden. You can display them using the <info>--show-hidden</info> flag: <info>php %command.full_name% --show-hidden</info>
parent::__construct();

        $this->dispatchers = $dispatchers;
    }

    protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputArgument('event', InputArgument::OPTIONAL, 'An event name or a part of the event name'),
                new InputOption('dispatcher', null, InputOption::VALUE_REQUIRED, 'To view events of a specific event dispatcher', self::DEFAULT_DISPATCHER),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
                new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command displays all configured listeners: <info>php %command.full_name%</info> To get specific listeners for an event, specify its name: <info>php %command.full_name% kernel.request</info> EOF
            )
/** * @return void */
    protected function configure()
    {
        $this
            ->setDefinition([
                new InputArgument('class', InputArgument::OPTIONAL, 'The form type class'),
                new InputArgument('option', InputArgument::OPTIONAL, 'The form type option'),
                new InputOption('show-deprecated', null, InputOption::VALUE_NONE, 'Display deprecated options in form types'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command displays information about form types. <info>php %command.full_name%</info> The command lists all built-in types, services types, type extensions and guessers currently available. <info>php %command.full_name% Symfony\Component\Form\Extension\Core\Type\ChoiceType</info> <info>php %command.full_name% ChoiceType</info> The command lists all defined options that contains the given form type, as well as their parents and type extensions. <info>php %command.full_name% ChoiceType choice_value</info> Use the <info>--show-deprecated</info> option to display form types with deprecated options or the deprecated options of the given form type: <info>php %command.full_name% --show-deprecated</info> <info>php %command.full_name% ChoiceType --show-deprecated</info> The command displays the definition of the given option name. <info>php %command.full_name% --format=json</info> The command lists everything in a machine readable json format.

#[AsCommand(name: 'debug:config', description: 'Dump the current configuration for an extension')] class ConfigDebugCommand extends AbstractConfigCommand
{
    protected function configure(): void
    {
        $commentedHelpFormats = array_map(fn ($format) => sprintf('<comment>%s</comment>', $format)$this->getAvailableFormatOptions());
        $helpFormats = implode('", "', $commentedHelpFormats);

        $this
            ->setDefinition([
                new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'),
                new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
                new InputOption('resolve-env', null, InputOption::VALUE_NONE, 'Display resolved environment variable values instead of placeholders'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions()))class_exists(Yaml::class) ? 'txt' : 'json'),
            ])
            ->setHelp(<<<EOF The <info>%command.name%</info> command dumps the current configuration for an extension/bundle. Either the extension alias or bundle name can be used: <info>php %command.full_name% framework</info> <info>php %command.full_name% FrameworkBundle</info> The <info>--format</info> option specifies the format of the configuration, these are "
$this->router = $router;
        $this->fileLinkFormatter = $fileLinkFormatter;
    }

    protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputArgument('name', InputArgument::OPTIONAL, 'A route name'),
                new InputOption('show-controllers', null, InputOption::VALUE_NONE, 'Show assigned controllers in overview'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
                new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw route(s)'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> displays the configured routes: <info>php %command.full_name%</info> EOF
            )
        ;
    }

    
$this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...);
        $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
    }

    /** * @return void */
    protected function configure()
    {
        $this
            ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
            ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
            ->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude')
            ->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null)
            ->setHelp(<<<EOF The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT the first encountered syntax error. You can validates YAML contents passed from STDIN: <info>cat filename | php %command.full_name% -</info> You can also validate the syntax of a file: <info>php %command.full_name% filename</info> Or of a whole directory: <info>php %command.full_name% dirname</info> <info>php %command.full_name% dirname --format=json</info> You can also exclude one or more specific files: <info>php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml"</info>
$this->factory = $factory ?? new UlidFactory();

        parent::__construct();
    }

    protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputOption('time', null, InputOption::VALUE_REQUIRED, 'The ULID timestamp: a parsable date/time string'),
                new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of ULID to generate', 1),
                new InputOption('format', 'f', InputOption::VALUE_REQUIRED, sprintf('The ULID output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'base32'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command generates a ULID. <info>php %command.full_name%</info> To specify the timestamp: <info>php %command.full_name% --time="2021-02-16 14:09:08"</info> To generate several ULIDs: <info>php %command.full_name% --count=10</info> To output a specific format: <info>php %command.full_name% --format=rfc4122</info>
$this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
        $this->requireStrictFileNames = $requireStrictFileNames;
    }

    /** * @return void */
    protected function configure()
    {
        $this
            ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
            ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
            ->setHelp(<<<EOF The <info>%command.name%</info> command lints an XLIFF file and outputs to STDOUT the first encountered syntax error. You can validates XLIFF contents passed from STDIN: <info>cat filename | php %command.full_name% -</info> You can also validate the syntax of a file: <info>php %command.full_name% filename</info> Or of a whole directory: <info>php %command.full_name% dirname</info> <info>php %command.full_name% dirname --format=json</info>


    /** * @return void */
    protected function configure()
    {
        $this
            ->setDefinition([
                new InputArgument('name', InputArgument::OPTIONAL, 'The template name'),
                new InputOption('filter', null, InputOption::VALUE_REQUIRED, 'Show details for all entries matching this filter'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'text'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command outputs a list of twig functions, filters, globals and tests. <info>php %command.full_name%</info> The command lists all functions, filters, etc. <info>php %command.full_name% @Twig/Exception/error.html.twig</info> The command lists all paths that match the given template name. <info>php %command.full_name% --filter=date</info> The command lists everything that contains the word date. <info>php %command.full_name% --format=json</info> The command lists everything in a machine readable json format.
$this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...);
        $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
    }

    /** * @return void */
    protected function configure()
    {
        $this
            ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
            ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
            ->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude')
            ->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null)
            ->setHelp(<<<EOF The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT the first encountered syntax error. You can validates YAML contents passed from STDIN: <info>cat filename | php %command.full_name% -</info> You can also validate the syntax of a file: <info>php %command.full_name% filename</info> Or of a whole directory: <info>php %command.full_name% dirname</info> <info>php %command.full_name% dirname --format=json</info> You can also exclude one or more specific files: <info>php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml"</info>
Home | Imprint | This part of the site doesn't use cookies.