4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Tests\Descriptor;
14 use Symfony\Component\Console\Input\InputArgument;
15 use Symfony\Component\Console\Input\InputDefinition;
16 use Symfony\Component\Console\Input\InputOption;
17 use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication1;
18 use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
19 use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand1;
20 use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand2;
23 * @author Jean-François Simon <contact@jfsimon.fr>
27 public static function getInputArguments()
30 'input_argument_1' => new InputArgument('argument_name', InputArgument::REQUIRED),
31 'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'),
32 'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
33 'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
34 'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', '<comment>style</>'),
38 public static function getInputOptions()
41 'input_option_1' => new InputOption('option_name', 'o', InputOption::VALUE_NONE),
42 'input_option_2' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', 'default_value'),
43 'input_option_3' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description'),
44 'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()),
45 'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"),
46 'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
47 'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', '<comment>style</>'),
48 'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('<comment>Hello</comment>', '<info>world</info>')),
52 public static function getInputDefinitions()
55 'input_definition_1' => new InputDefinition(),
56 'input_definition_2' => new InputDefinition(array(new InputArgument('argument_name', InputArgument::REQUIRED))),
57 'input_definition_3' => new InputDefinition(array(new InputOption('option_name', 'o', InputOption::VALUE_NONE))),
58 'input_definition_4' => new InputDefinition(array(
59 new InputArgument('argument_name', InputArgument::REQUIRED),
60 new InputOption('option_name', 'o', InputOption::VALUE_NONE),
65 public static function getCommands()
68 'command_1' => new DescriptorCommand1(),
69 'command_2' => new DescriptorCommand2(),
73 public static function getApplications()
76 'application_1' => new DescriptorApplication1(),
77 'application_2' => new DescriptorApplication2(),