1
0
Fork 0

Merge remote-tracking branch 'dmanners/add-chat-option-for-support'

pull/7806/head
Jordi Boggiano 2018-11-26 19:47:13 +01:00
commit 85ec111dee
3 changed files with 6 additions and 2 deletions

View File

@ -243,6 +243,7 @@ Support information includes the following:
* **source:** URL to browse or download the sources.
* **docs:** URL to the documentation.
* **rss:** URL to the RSS feed.
* **chat:** URL to the chat channel.
An example:

View File

@ -161,7 +161,7 @@ class ValidatingArrayLoader implements LoaderInterface
}
if ($this->validateArray('support') && !empty($this->config['support'])) {
foreach (array('issues', 'forum', 'wiki', 'source', 'email', 'irc', 'docs', 'rss') as $key) {
foreach (array('issues', 'forum', 'wiki', 'source', 'email', 'irc', 'docs', 'rss', 'chat') 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]);
@ -178,7 +178,7 @@ class ValidatingArrayLoader implements LoaderInterface
unset($this->config['support']['irc']);
}
foreach (array('issues', 'forum', 'wiki', 'source', 'docs') as $key) {
foreach (array('issues', 'forum', 'wiki', 'source', 'docs', 'chat') 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]);

View File

@ -71,6 +71,7 @@ class ValidatingArrayLoaderTest extends TestCase
'source' => 'http://example.org/',
'irc' => 'irc://example.org/example',
'rss' => 'http://example.org/rss',
'chat' => 'http://example.org/chat',
),
'require' => array(
'a/b' => '1.*',
@ -305,6 +306,7 @@ class ValidatingArrayLoaderTest extends TestCase
'forum' => 'foo:bar',
'issues' => 'foo:bar',
'wiki' => 'foo:bar',
'chat' => 'foo:bar',
),
),
array(
@ -312,6 +314,7 @@ class ValidatingArrayLoaderTest extends TestCase
'support.forum : invalid value (foo:bar), must be an http/https URL',
'support.issues : invalid value (foo:bar), must be an http/https URL',
'support.wiki : invalid value (foo:bar), must be an http/https URL',
'support.chat : invalid value (foo:bar), must be an http/https URL',
),
),
array(