8000 feature #14928 Removed deprecated stuff from the Console component (d… · symfony/symfony@35f0a32 · GitHub
[go: up one dir, main page]

Skip to content

Commit 35f0a32

Browse files
committed
feature #14928 Removed deprecated stuff from the Console component (dosten)
This PR was merged into the 3.0-dev branch. Discussion ---------- Removed deprecated stuff from the Console component | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- a2a449c Removed deprecated stuff from the Console component
2 parents 456542a + a2a449c commit 35f0a32

13 files changed

+14
-88
lines changed

src/Symfony/Component/Console/Command/HelpCommand.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ protected function configure()
3737
->setName('help')
3838
->setDefinition(array(
3939
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
40-
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
4140
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
4241
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
4342
))
@@ -76,12 +75,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
7675
$this->command = $this->getApplication()->find($input->getArgument('command_name'));
7776
}
7877

79-
if ($input->getOption('xml')) {
80-
@trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
81-
82-
$input->setOption('format', 'xml');
83-
}
84-
8578
$helper = new DescriptorHelper();
8679
$helper->describe($output, $this->command, array(
8780
'format' => $input->getOption('format'),

src/Symfony/Component/Console/Command/ListCommand.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ public function getNativeDefinition()
6868
*/
6969
protected function execute(InputInterface $input, OutputInterface $output)
7070
{
71-
if ($input->getOption('xml')) {
72-
@trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
73-
74-
$input->setOption('format', 'xml');
75-
}
76-
7771
$helper = new DescriptorHelper();
7872
$helper->describe($output, $this->getApplication(), array(
7973
'format' => $input->getOption('format'),
@@ -89,7 +83,6 @@ private function createDefinition()
8983
{
9084
return new InputDefinition(array(
9185
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
92-
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML'),
9386
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
9487
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
9588
));

src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testExecuteForApplicationCommandWithXmlOption()
6464
$application = new Application();
6565
$commandTester = new CommandTester($application->get('help'));
6666
$commandTester->execute(array('command_name' => 'list', '--format' => 'xml'));
67-
$this->assertContains('list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
67+
$this->assertContains('list [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
6868
$this->assertContains('<command', $commandTester->getDisplay(), '->execute() returns an XML help text if --format=xml is passed');
6969
}
7070
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"commands":[{"name":"help","usage":["help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]"],"description":"Displays help for a command","help":"The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version&q A3E2 uot;,"shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]"],"description":"Lists commands","help":"The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]}
1+
{"commands":[{"name":"help","usage":["help [--format FORMAT] [--raw] [--] [<command_name>]"],"description":"Displays help for a command","help":"The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--raw] [--format FORMAT] [--] [<namespace>]"],"description":"Lists commands","help":"The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]}

src/Symfony/Component/Console/Tests/Fixtures/application_1.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ help
1010
* Description: Displays help for a command
1111
* Usage:
1212

13-
* `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
13+
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
1414

1515
The <info>help</info> command displays help for a given command:
1616

@@ -34,16 +34,6 @@ To display the list of available commands, please use the <info>list</info> comm
3434

3535
### Options:
3636

37-
**xml:**
38-
39-
* Name: `--xml`
40-
* Shortcut: <none>
41-
* Accept value: no
42-
* Is value required: no
43-
* Is multiple: no
44-
* Description: To output help as XML
45-
* Default: `false`
46-
4737
**format:**
4838

4939
* Name: `--format`
@@ -140,7 +130,7 @@ list
140130
* Description: Lists commands
141131
* Usage:
142132

143-
* `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
133+
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
144134

145135
The <info>list</info> command lists all commands:
146136

@@ -170,16 +160,6 @@ It's also possible to get raw list of commands (useful for embedding command run
170160

171161
### Options:
172162

173-
**xml:**
174-
175-
* Name: `--xml`
176-
* Shortcut: <none>
177-
* Accept value: no
178-
* Is value required: no
179-
* Is multiple: no
180-
* Description: To output list as XML
181-
* Default: `false`
182-
183163
**raw:**
184164

185165
* Name: `--raw`

src/Symfony/Component/Console/Tests/Fixtures/application_1.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<commands>
44
<command id="help" name="help">
55
<usages>
6-
<usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
6+
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
77
</usages>
88
<description>Displays help for a command</description>
99
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
@@ -24,9 +24,6 @@
2424
</argument>
2525
</arguments>
2626
<options>
27-
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
28-
<description>To output help as XML</description>
29-
</option>
3027
<option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
3128
<description>The output format (txt, xml, json, or md)</description>
3229
<defaults>
@@ -61,7 +58,7 @@
6158
</command>
6259
<command id="list" name="list">
6360
<usages>
64-
<usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
61+
<usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
6562
</usages>
6663
<description>Lists commands</description>
6764
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
@@ -86,9 +83,6 @@
8683
</argument>
8784
</arguments>
8885
<options>
89-
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
90-
<description>To output list as XML</description>
91-
</option>
9286
<option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
9387
<description>To output raw command list</description>
9488
</option>

0 commit comments

Comments
 (0)
0