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: Support information includes the following:
* **email:** Email address for support. * **email:** Email address for support.
* **issues:** URL to the Issue Tracker. * **issues:** URL to the issue tracker.
* **forum:** URL to the Forum. * **forum:** URL to the forum.
* **wiki:** URL to the Wiki. * **wiki:** URL to the wiki.
* **irc:** IRC channel for support, as irc://server/channel. * **irc:** IRC channel for support, as irc://server/channel.
* **source:** URL to browse or download the sources. * **source:** URL to browse or download the sources.
* **docs:** URL to the documentation.
An example: An example:

View File

@ -390,17 +390,17 @@
}, },
"issues": { "issues": {
"type": "string", "type": "string",
"description": "URL to the Issue Tracker.", "description": "URL to the issue tracker.",
"format": "uri" "format": "uri"
}, },
"forum": { "forum": {
"type": "string", "type": "string",
"description": "URL to the Forum.", "description": "URL to the forum.",
"format": "uri" "format": "uri"
}, },
"wiki": { "wiki": {
"type": "string", "type": "string",
"description": "URL to the Wiki.", "description": "URL to the wiki.",
"format": "uri" "format": "uri"
}, },
"irc": { "irc": {
@ -412,6 +412,11 @@
"type": "string", "type": "string",
"description": "URL to browse or download the sources.", "description": "URL to browse or download the sources.",
"format": "uri" "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'])) { 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])) { if (isset($this->config['support'][$key]) && !is_string($this->config['support'][$key])) {
$this->errors[] = 'support.'.$key.' : invalid value, must be a string'; $this->errors[] = 'support.'.$key.' : invalid value, must be a string';
unset($this->config['support'][$key]); unset($this->config['support'][$key]);
@ -138,7 +138,7 @@ class ValidatingArrayLoader implements LoaderInterface
unset($this->config['support']['irc']); 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])) { 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'; $this->warnings[] = 'support.'.$key.' : invalid value ('.$this->config['support'][$key].'), must be an http/https URL';
unset($this->config['support'][$key]); unset($this->config['support'][$key]);