1
0
Fork 0

Merge pull request #4075 from alcohol/add-docs-to-support-in-schema

Add docs to composer schema in support section - closes #4055
pull/4078/head
Jordi Boggiano 2015-05-28 12:17:36 +01:00
commit eef1294123
3 changed files with 14 additions and 8 deletions

View File

@ -235,11 +235,12 @@ Various information to get support about the project.
Support information includes the following:
* **email:** Email address for support.
* **issues:** URL to the Issue Tracker.
* **forum:** URL to the Forum.
* **wiki:** URL to the Wiki.
* **issues:** URL to the issue tracker.
* **forum:** URL to the forum.
* **wiki:** URL to the wiki.
* **irc:** IRC channel for support, as irc://server/channel.
* **source:** URL to browse or download the sources.
* **docs:** URL to the documentation.
An example:

View File

@ -390,17 +390,17 @@
},
"issues": {
"type": "string",
"description": "URL to the Issue Tracker.",
"description": "URL to the issue tracker.",
"format": "uri"
},
"forum": {
"type": "string",
"description": "URL to the Forum.",
"description": "URL to the forum.",
"format": "uri"
},
"wiki": {
"type": "string",
"description": "URL to the Wiki.",
"description": "URL to the wiki.",
"format": "uri"
},
"irc": {
@ -412,6 +412,11 @@
"type": "string",
"description": "URL to browse or download the sources.",
"format": "uri"
},
"docs": {
"type": "string",
"description": "URL to the documentation.",
"format": "uri"
}
}
},

View File

@ -121,7 +121,7 @@ class ValidatingArrayLoader implements LoaderInterface
}
if ($this->validateArray('support') && !empty($this->config['support'])) {
foreach (array('issues', 'forum', 'wiki', 'source', 'email', 'irc') as $key) {
foreach (array('issues', 'forum', 'wiki', 'source', 'email', 'irc', 'docs') as $key) {
if (isset($this->config['support'][$key]) && !is_string($this->config['support'][$key])) {
$this->errors[] = 'support.'.$key.' : invalid value, must be a string';
unset($this->config['support'][$key]);
@ -138,7 +138,7 @@ class ValidatingArrayLoader implements LoaderInterface
unset($this->config['support']['irc']);
}
foreach (array('issues', 'forum', 'wiki', 'source') as $key) {
foreach (array('issues', 'forum', 'wiki', 'source', 'docs') as $key) {
if (isset($this->config['support'][$key]) && !$this->filterUrl($this->config['support'][$key])) {
$this->warnings[] = 'support.'.$key.' : invalid value ('.$this->config['support'][$key].'), must be an http/https URL';
unset($this->config['support'][$key]);