Merge branch '3.1'
* 3.1: format json fixtures cleanup apply rtrim
This commit is contained in:
commit
f1c1e37949
@ -1 +1,154 @@
|
||||
{"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"]}]}
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,20 +0,0 @@
|
||||
<info>Console Tool</info>
|
||||
|
||||
<comment>Usage:</comment>
|
||||
command [options] [arguments]
|
||||
|
||||
<comment>Options:</comment>
|
||||
<info>-h, --help</info> Display this help message
|
||||
<info>-q, --quiet</info> Do not output any message
|
||||
<info>-V, --version</info> Display this application version
|
||||
<info> --ansi</info> Force ANSI output
|
||||
<info> --no-ansi</info> Disable ANSI output
|
||||
<info>-n, --no-interaction</info> Do not ask any interactive question
|
||||
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
|
||||
|
||||
<comment>Available commands:</comment>
|
||||
<info>afoobar</info> The foo:bar command
|
||||
<info>help</info> Displays help for a command
|
||||
<info>list</info> Lists commands
|
||||
<comment>foo</comment>
|
||||
<info>foo:bar</info> The foo:bar command
|
@ -1,16 +0,0 @@
|
||||
<info>Console Tool</info>
|
||||
|
||||
<comment>Usage:</comment>
|
||||
command [options] [arguments]
|
||||
|
||||
<comment>Options:</comment>
|
||||
<info>-h, --help</info> Display this help message
|
||||
<info>-q, --quiet</info> Do not output any message
|
||||
<info>-V, --version</info> Display this application version
|
||||
<info> --ansi</info> Force ANSI output
|
||||
<info> --no-ansi</info> Disable ANSI output
|
||||
<info>-n, --no-interaction</info> Do not ask any interactive question
|
||||
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
|
||||
|
||||
<comment>Available commands for the "foo" namespace:</comment>
|
||||
<info>foo:bar</info> The foo:bar command
|
@ -1 +1,14 @@
|
||||
{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":[]}}
|
||||
{
|
||||
"name": "descriptor:command1",
|
||||
"usage": [
|
||||
"descriptor:command1",
|
||||
"alias1",
|
||||
"alias2"
|
||||
],
|
||||
"description": "command 1 description",
|
||||
"help": "command 1 help",
|
||||
"definition": {
|
||||
"arguments": [],
|
||||
"options": []
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,32 @@
|
||||
{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] <argument_name>", "descriptor:command2 -o|--option_name <argument_name>", "descriptor:command2 <argument_name>"],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}}
|
||||
{
|
||||
"name": "descriptor:command2",
|
||||
"usage": [
|
||||
"descriptor:command2 [-o|--option_name] [--] <argument_name>",
|
||||
"descriptor:command2 -o|--option_name <argument_name>",
|
||||
"descriptor:command2 <argument_name>"
|
||||
],
|
||||
"description": "command 2 description",
|
||||
"help": "command 2 help",
|
||||
"definition": {
|
||||
"arguments": {
|
||||
"argument_name": {
|
||||
"name": "argument_name",
|
||||
"is_required": true,
|
||||
"is_array": false,
|
||||
"description": "",
|
||||
"default": null
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"option_name": {
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": false,
|
||||
"is_value_required": false,
|
||||
"is_multiple": false,
|
||||
"description": "",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
<comment>Usage:</comment>
|
||||
namespace:name
|
||||
name
|
||||
|
||||
<comment>Arguments:</comment>
|
||||
<info>command</info> The command to execute
|
||||
|
||||
<comment>Options:</comment>
|
||||
<info>-h, --help</info> Display this help message
|
||||
<info>-q, --quiet</info> Do not output any message
|
||||
<info>-V, --version</info> Display this application version
|
||||
<info> --ansi</info> Force ANSI output
|
||||
<info> --no-ansi</info> Disable ANSI output
|
||||
<info>-n, --no-interaction</info> Do not ask any interactive question
|
||||
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
|
||||
|
||||
<comment>Help:</comment>
|
||||
help
|
@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<command id="namespace:name" name="namespace:name">
|
||||
<usages>
|
||||
<usage>namespace:name</usage>
|
||||
<usage>name</usage>
|
||||
</usages>
|
||||
<description>description</description>
|
||||
<help>help</help>
|
||||
<arguments>
|
||||
<argument name="command" is_required="1" is_array="0">
|
||||
<description>The command to execute</description>
|
||||
<defaults/>
|
||||
</argument>
|
||||
</arguments>
|
||||
<options>
|
||||
<option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Display this help message</description>
|
||||
</option>
|
||||
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Do not output any message</description>
|
||||
</option>
|
||||
<option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
|
||||
</option>
|
||||
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Display this application version</description>
|
||||
</option>
|
||||
<option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Force ANSI output</description>
|
||||
</option>
|
||||
<option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Disable ANSI output</description>
|
||||
</option>
|
||||
<option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
|
||||
<description>Do not ask any interactive question</description>
|
||||
</option>
|
||||
</options>
|
||||
</command>
|
@ -1,11 +0,0 @@
|
||||
<comment>Arguments:</comment>
|
||||
<info>foo</info> The foo argument
|
||||
<info>baz</info> The baz argument<comment> [default: true]</comment>
|
||||
<info>bar</info> The bar argument<comment> [default: ["http://foo.com/"]]</comment>
|
||||
|
||||
<comment>Options:</comment>
|
||||
<info>-f, --foo=FOO</info> The foo option
|
||||
<info> --baz[=BAZ]</info> The baz option<comment> [default: false]</comment>
|
||||
<info>-b, --bar[=BAR]</info> The bar option<comment> [default: "bar"]</comment>
|
||||
<info> --qux[=QUX]</info> The qux option<comment> [default: ["http://foo.com/","bar"]]</comment><comment> (multiple values allowed)</comment>
|
||||
<info> --qux2[=QUX2]</info> The qux2 option<comment> [default: {"foo":"bar"}]</comment><comment> (multiple values allowed)</comment>
|
@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definition>
|
||||
<arguments>
|
||||
<argument name="foo" is_required="0" is_array="0">
|
||||
<description>The foo argument</description>
|
||||
<defaults/>
|
||||
</argument>
|
||||
<argument name="baz" is_required="0" is_array="0">
|
||||
<description>The baz argument</description>
|
||||
<defaults>
|
||||
<default>true</default>
|
||||
</defaults>
|
||||
</argument>
|
||||
<argument name="bar" is_required="0" is_array="1">
|
||||
<description>The bar argument</description>
|
||||
<defaults>
|
||||
<default>bar</default>
|
||||
</defaults>
|
||||
</argument>
|
||||
</arguments>
|
||||
<options>
|
||||
<option name="--foo" shortcut="-f" accept_value="1" is_value_required="1" is_multiple="0">
|
||||
<description>The foo option</description>
|
||||
<defaults/>
|
||||
</option>
|
||||
<option name="--baz" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
|
||||
<description>The baz option</description>
|
||||
<defaults>
|
||||
<default>false</default>
|
||||
</defaults>
|
||||
</option>
|
||||
<option name="--bar" shortcut="-b" accept_value="1" is_value_required="0" is_multiple="0">
|
||||
<description>The bar option</description>
|
||||
<defaults>
|
||||
<default>bar</default>
|
||||
</defaults>
|
||||
</option>
|
||||
</options>
|
||||
</definition>
|
@ -1 +1,7 @@
|
||||
{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}
|
||||
{
|
||||
"name": "argument_name",
|
||||
"is_required": true,
|
||||
"is_array": false,
|
||||
"description": "",
|
||||
"default": null
|
||||
}
|
||||
|
@ -1 +1,7 @@
|
||||
{"name":"argument_name","is_required":false,"is_array":true,"description":"argument description","default":[]}
|
||||
{
|
||||
"name": "argument_name",
|
||||
"is_required": false,
|
||||
"is_array": true,
|
||||
"description": "argument description",
|
||||
"default": []
|
||||
}
|
||||
|
@ -1 +1,7 @@
|
||||
{"name":"argument_name","is_required":false,"is_array":false,"description":"argument description","default":"default_value"}
|
||||
{
|
||||
"name": "argument_name",
|
||||
"is_required": false,
|
||||
"is_array": false,
|
||||
"description": "argument description",
|
||||
"default": "default_value"
|
||||
}
|
||||
|
@ -1 +1,7 @@
|
||||
{"name":"argument_name","is_required":true,"is_array":false,"description":"multiline argument description","default":null}
|
||||
{
|
||||
"name": "argument_name",
|
||||
"is_required": true,
|
||||
"is_array": false,
|
||||
"description": "multiline argument description",
|
||||
"default": null
|
||||
}
|
||||
|
@ -1 +1,4 @@
|
||||
{"arguments":[],"options":[]}
|
||||
{
|
||||
"arguments": [],
|
||||
"options": []
|
||||
}
|
||||
|
@ -1 +1,12 @@
|
||||
{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":[]}
|
||||
{
|
||||
"arguments": {
|
||||
"argument_name": {
|
||||
"name": "argument_name",
|
||||
"is_required": true,
|
||||
"is_array": false,
|
||||
"description": "",
|
||||
"default": null
|
||||
}
|
||||
},
|
||||
"options": []
|
||||
}
|
||||
|
@ -1 +1,14 @@
|
||||
{"arguments":[],"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}
|
||||
{
|
||||
"arguments": [],
|
||||
"options": {
|
||||
"option_name": {
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": false,
|
||||
"is_value_required": false,
|
||||
"is_multiple": false,
|
||||
"description": "",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,22 @@
|
||||
{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}
|
||||
{
|
||||
"arguments": {
|
||||
"argument_name": {
|
||||
"name": "argument_name",
|
||||
"is_required": true,
|
||||
"is_array": false,
|
||||
"description": "",
|
||||
"default": null
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"option_name": {
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": false,
|
||||
"is_value_required": false,
|
||||
"is_multiple": false,
|
||||
"description": "",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,9 @@
|
||||
{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}
|
||||
{
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": false,
|
||||
"is_value_required": false,
|
||||
"is_multiple": false,
|
||||
"description": "",
|
||||
"default": false
|
||||
}
|
||||
|
@ -1 +1,9 @@
|
||||
{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":false,"description":"option description","default":"default_value"}
|
||||
{
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": true,
|
||||
"is_value_required": false,
|
||||
"is_multiple": false,
|
||||
"description": "option description",
|
||||
"default": "default_value"
|
||||
}
|
||||
|
@ -1 +1,9 @@
|
||||
{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option description","default":null}
|
||||
{
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": true,
|
||||
"is_value_required": true,
|
||||
"is_multiple": false,
|
||||
"description": "option description",
|
||||
"default": null
|
||||
}
|
||||
|
@ -1 +1,9 @@
|
||||
{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":true,"description":"option description","default":[]}
|
||||
{
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": true,
|
||||
"is_value_required": false,
|
||||
"is_multiple": true,
|
||||
"description": "option description",
|
||||
"default": []
|
||||
}
|
||||
|
@ -1 +1,9 @@
|
||||
{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"multiline option description","default":null}
|
||||
{
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o",
|
||||
"accept_value": true,
|
||||
"is_value_required": true,
|
||||
"is_multiple": false,
|
||||
"description": "multiline option description",
|
||||
"default": null
|
||||
}
|
||||
|
@ -1 +1,9 @@
|
||||
{"name":"--option_name","shortcut":"-o|-O","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option with multiple shortcuts","default":null}
|
||||
{
|
||||
"name": "--option_name",
|
||||
"shortcut": "-o|-O",
|
||||
"accept_value": true,
|
||||
"is_value_required": true,
|
||||
"is_multiple": false,
|
||||
"description": "option with multiple shortcuts",
|
||||
"default": null
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ class ExcludeDirectoryFilterIterator extends FilterIterator implements \Recursiv
|
||||
$this->isRecursive = $iterator instanceof \RecursiveIterator;
|
||||
$patterns = array();
|
||||
foreach ($directories as $directory) {
|
||||
$directory = rtrim($directory, '/');
|
||||
if (!$this->isRecursive || false !== strpos($directory, '/')) {
|
||||
$patterns[] = preg_quote($directory, '#');
|
||||
} else {
|
||||
@ -51,7 +52,7 @@ class ExcludeDirectoryFilterIterator extends FilterIterator implements \Recursiv
|
||||
/**
|
||||
* Filters the iterator values.
|
||||
*
|
||||
* @return bool true if the value should be kept, false otherwise
|
||||
* @return bool True if the value should be kept, false otherwise
|
||||
*/
|
||||
public function accept()
|
||||
{
|
||||
|
@ -58,9 +58,23 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
|
||||
'foo bar',
|
||||
);
|
||||
|
||||
$toto = array(
|
||||
'.bar',
|
||||
'.foo',
|
||||
'.foo/.bar',
|
||||
'.foo/bar',
|
||||
'.git',
|
||||
'test.py',
|
||||
'foo',
|
||||
'foo/bar.tmp',
|
||||
'test.php',
|
||||
'foo bar',
|
||||
);
|
||||
|
||||
return array(
|
||||
array(array('foo'), $this->toAbsolute($foo)),
|
||||
array(array('fo'), $this->toAbsolute($fo)),
|
||||
array(array('toto/'), $this->toAbsolute($toto)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user