$alterOptionsEventManager = new AlterOptionsCommandEvent($this->application);
$eventDispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
$eventDispatcher->addSubscriber($this->commandFactory->commandProcessor()->hookManager());
- $eventDispatcher->addSubscriber($alterOptionsEventManager);
+ $this->commandFactory->commandProcessor()->hookManager()->addCommandEvent($alterOptionsEventManager);
$this->application->setDispatcher($eventDispatcher);
$this->application->setAutoExit(false);
function simplifyWhitespace($data)
{
- return trim(preg_replace('#[ \t]+$#m', '', $data));
+ return trim(preg_replace('#\s+$#m', '', $data));
}
function testHelp()
<?xml version="1.0" encoding="UTF-8"?>
<command id="example:table" name="example:table">
<usages>
- <usage>example:table [--format [FORMAT]] [--fields [FIELDS]] [--field [FIELD]] [--] [<unused>]</usage>
+ <usage>example:table [--format [FORMAT]] [--fields [FIELDS]] [--field FIELD] [--] [<unused>]</usage>
</usages>
<examples>
<example>
<description>Available fields: I (first), II (second), III (third)</description>
<defaults/>
</option>
- <option name="--field" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
+ <option name="--field" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
<description>Select just one field, and force format to 'string'.</description>
<defaults/>
</option>
"id": "example:table",
"name": "example:table",
"usages": [
- "example:table [--format [FORMAT]] [--fields [FIELDS]] [--field [FIELD]] [--] [<unused>]"
+ "example:table [--format [FORMAT]] [--fields [FIELDS]] [--field FIELD] [--] [<unused>]"
],
"examples": [
{
"name": "--field",
"shortcut": "",
"accept_value": "1",
- "is_value_required": "0",
+ "is_value_required": "1",
"is_multiple": "0",
"description": "Select just one field, and force format to 'string'."
},
}
},
"help": "Test command with formatters",
- "alias": "extab",
+ "aliases": [
+ "extab"
+ ],
"topics": [
"docs-tables"
]