PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.8.2
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.8.2
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / prefixed / symfony / console / Command / ListCommand.php
matomo / app / vendor / prefixed / symfony / console / Command Last commit date
Command.php 1 year ago CompleteCommand.php 1 year ago DumpCompletionCommand.php 2 years ago HelpCommand.php 2 years ago LazyCommand.php 1 year ago ListCommand.php 2 years ago LockableTrait.php 1 year ago SignalableCommandInterface.php 2 years ago
ListCommand.php
74 lines
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 namespace Matomo\Dependencies\Symfony\Component\Console\Command;
12
13 use Matomo\Dependencies\Symfony\Component\Console\Completion\CompletionInput;
14 use Matomo\Dependencies\Symfony\Component\Console\Completion\CompletionSuggestions;
15 use Matomo\Dependencies\Symfony\Component\Console\Descriptor\ApplicationDescription;
16 use Matomo\Dependencies\Symfony\Component\Console\Helper\DescriptorHelper;
17 use Matomo\Dependencies\Symfony\Component\Console\Input\InputArgument;
18 use Matomo\Dependencies\Symfony\Component\Console\Input\InputInterface;
19 use Matomo\Dependencies\Symfony\Component\Console\Input\InputOption;
20 use Matomo\Dependencies\Symfony\Component\Console\Output\OutputInterface;
21 /**
22 * ListCommand displays the list of all available commands for the application.
23 *
24 * @author Fabien Potencier <fabien@symfony.com>
25 */
26 class ListCommand extends Command
27 {
28 /**
29 * {@inheritdoc}
30 */
31 protected function configure()
32 {
33 $this->setName('list')->setDefinition([new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments')])->setDescription('List commands')->setHelp(<<<'EOF'
34 The <info>%command.name%</info> command lists all commands:
35
36 <info>%command.full_name%</info>
37
38 You can also display the commands for a specific namespace:
39
40 <info>%command.full_name% test</info>
41
42 You can also output the information in other formats by using the <comment>--format</comment> option:
43
44 <info>%command.full_name% --format=xml</info>
45
46 It's also possible to get raw list of commands (useful for embedding command runner):
47
48 <info>%command.full_name% --raw</info>
49 EOF
50 );
51 }
52 /**
53 * {@inheritdoc}
54 */
55 protected function execute(InputInterface $input, OutputInterface $output)
56 {
57 $helper = new DescriptorHelper();
58 $helper->describe($output, $this->getApplication(), ['format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace'), 'short' => $input->getOption('short')]);
59 return 0;
60 }
61 public function complete(CompletionInput $input, CompletionSuggestions $suggestions) : void
62 {
63 if ($input->mustSuggestArgumentValuesFor('namespace')) {
64 $descriptor = new ApplicationDescription($this->getApplication());
65 $suggestions->suggestValues(array_keys($descriptor->getNamespaces()));
66 return;
67 }
68 if ($input->mustSuggestOptionValuesFor('format')) {
69 $helper = new DescriptorHelper();
70 $suggestions->suggestValues($helper->getFormats());
71 }
72 }
73 }
74