8000 [Console] application/command as text/xml/whatever decoupling by jfsimon · Pull Request #7454 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] application/command as text/xml/whatever decoupling #7454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
da67c12
[Console] added descriptor & refactored description commands
jfsimon Mar 22, 2013
f239b1c
[Console] added JSON descriptors
jfsimon Apr 1, 2013
bebf1eb
[Console] added markdown descriptors
jfsimon Apr 3, 2013
43b5e5c
[Console] added forgotten headers
jfsimon Apr 3, 2013
acc7414
[Console] removed unused methods (tests broken)
jfsimon Apr 3, 2013
774794c
[Console] fixed tests
jfsimon Apr 3, 2013
2066a9b
[Console] added XML descriptors
jfsimon Apr 6, 2013
47fa194
[Console] started text derciptors
jfsimon Apr 6, 2013
8b56eb1
[Console] finished text descriptors
jfsimon Apr 8, 2013
27aa872
[Console] repaired tests
jfsimon Apr 10, 2013
30d8807
[Console] re-introduced asText & asXml methods to avoid BC break
jfsimon Apr 14, 2013
9964838
[Console] added command definition merge be fore description
jfsimon Apr 14, 2013
ef6d8ba
[Console] simplified description commands
jfsimon Apr 14, 2013
389101a
[Console] re-introduced --xml option to avoid BC break
jfsimon Apr 14, 2013
84be8de
[Console] simplified mardown descriptors
jfsimon Apr 14, 2013
ce5c0fd
[Console] applied comments from github
jfsimon Apr 14, 2013
49a4612
[Console] applied comments from github
jfsimon Apr 14, 2013
20c10a5
[Console] added provider injection to descriptors
jfsimon Apr 14, 2013
9c7b358
[Console] simplified descriptors
jfsimon Apr 23, 2013
d3ec073
[Console] applied advices from github comments
jfsimon Apr 23, 2013
d70e086
[Console] removed proxy
jfsimon Apr 23, 2013
ce60fb7
[Console] simplified descriptor interface
jfsimon Apr 23, 2013
28f082e
[Console] removed changes
jfsimon Apr 23, 2013
cbb8105
[Console] moved commands arguments
jfsimon Apr 23, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Next Next commit
[Console] applied comments from github
  • Loading branch information
jfsimon committed Apr 14, 2013
8000
commit ce5c0fd8a9cf1ff17bc8c58d877248c4b71dfc5f
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ public static function getAbbreviations($names)
*
* @return string A string representing the Application
*
* @deprecated
* @deprecated Deprecated since version 2.3, to be removed in 3.0.
*/
public function asText($namespace = null, $raw = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to provide a BC layer to avoid the BC break

{
Expand All @@ -707,7 +707,7 @@ public function asText($namespace = null, $raw = false)
*
* @return string|\DOMDocument An XML string representing the Application
*
* @deprecated
* @deprecated Deprecated since version 2.3, to be removed in 3.0.
*/
public function asXml($namespace = null, $asDom = false)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ public function getHelper($name)
*
* @return string A string representing the command
*
* @deprecated
* @deprecated Deprecated since version 2.3, to be removed in 3.0.
*/
public function asText()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also requires a BC layer

{
Expand All @@ -578,7 +578,7 @@ public function asText()
*
* @return string|\DOMDocument An XML string representing the command
*
* @deprecated
* @deprecated Deprecated since version 2.3, to be removed in 3.0.
*/
public function asXml($asDom = false)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Console/Command/HelpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->command = $this->getApplication()->find($input->getArgument('command_name'));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--xml is still supported, so we must convert it to the right format too.

if ($input->getOption('xml')) {
$input->setOption('format', 'xml');
}

$helper = new DescriptorHelper();
$helper->describe($output, $this->command, $input->getOption('format'), $input->getOption('raw'));
$this->command = null;
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Console/Command/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ protected function getNativeDefinition()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('xml')) {
$input->setOption('format', 'xml');
}

$helper = new DescriptorHelper();
$helper->describe($output, $this->getApplication(), $input->getOption('format'), $input->getOption('raw'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getCommands()
public function getCommand($name)
{
if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
throw new \InvalidArgumentException('Command "'.$name.'" does not exist.');
throw new \InvalidArgumentException(sprintf('Command %s does not exist.', $name));
}

return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name];
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Input/InputDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public function getSynopsis()
*
* @return string A string representing the InputDefinition
*
* @deprecated
* @deprecated Deprecated since version 2.3, to be removed in 3.0.
*/
public function asText()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the public method is a BC break. you should provide a BC layer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess asXml() methods should be present too and must be tagged as @deprecated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right

{
Expand All @@ -425,7 +425,7 @@ public function asText()
*
* @return string|\DOMDocument An XML string representing the InputDefinition
*
* @deprecated
* @deprecated Deprecated since version 2.3, to be removed in 3.0.
*/
public function asXml($asDom = false)
{
Expand Down
0