Skip to content
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

[generate-chain] Fix chain output #2516

Merged
merged 22 commits into from
Jul 13, 2016
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
63c146a
[generate:post:update] New Command
enzolutions May 26, 2016
937e2f6
Merge remote-tracking branch 'upstream/master'
enzolutions May 28, 2016
aa4fd4b
Merge remote-tracking branch 'upstream/master'
enzolutions May 28, 2016
7e2df3e
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 10, 2016
0fcf691
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 15, 2016
6cd9526
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 21, 2016
f3a04fd
Fixed services call as option in some commands
enzolutions Jun 21, 2016
267a4e9
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 21, 2016
0278e26
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 22, 2016
93f3007
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 23, 2016
3dd0a37
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 25, 2016
e1a8745
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 26, 2016
515c1fb
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 26, 2016
4f7814e
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 27, 2016
76bba26
Merge remote-tracking branch 'upstream/master'
enzolutions Jun 29, 2016
db29030
Merge remote-tracking branch 'upstream/master'
enzolutions Jul 3, 2016
4fa8163
Merge remote-tracking branch 'upstream/master'
enzolutions Jul 3, 2016
e4d45c9
Language separation
enzolutions Jul 12, 2016
40adb3e
Revert "Language separation"
enzolutions Jul 12, 2016
0180381
Merge remote-tracking branch 'upstream/master'
enzolutions Jul 12, 2016
ebe8bac
Fixed genrate-chain output
enzolutions Jul 13, 2016
4367fe0
Fixed genrate-chain output
enzolutions Jul 13, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/EventSubscriber/ShowGenerateChainListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function showGenerateChain(ConsoleTerminateEvent $event)
$input = $event->getInput();

if ($input->getOption('generate-chain')) {
$commands = [];
$options = array_filter($input->getOptions());
foreach ($this->skipOptions as $remove_option) {
unset($options[$remove_option]);
Expand All @@ -75,16 +76,18 @@ public function showGenerateChain(ConsoleTerminateEvent $event)
unset($arguments[$remove_argument]);
}

$commandDefinition = [];
$commands['commands'][0]['command'] = $command_name;

if ($options) {
$commandDefinition[$command_name]['options'] = $options;
$commands['commands'][0]['options'] = $options;
}

if ($arguments) {
$commandDefinition[$command_name]['arguments'] = $arguments;
$commands['commands'][0]['arguments'] = $arguments;
}

$dumper = new Dumper();
$yml = $dumper->dump($commandDefinition, 10);
$yml = $dumper->dump($commands, 10);

$yml = str_replace(
sprintf('\'%s\':', $command_name),
Expand Down