$result->addValue( null, 'version', '1.0' );
$result->addValue( null, 'xmlns', 'http://archipelago.phrasewise.com/rsd' );
- $service = array(
+ $service = [
'apis' => $this->formatRsdApiList(),
'engineName' => 'MediaWiki',
'engineLink' => 'https://www.mediawiki.org/',
'homePageLink' => Title::newMainPage()->getCanonicalURL(),
- );
+ ];
- ApiResult::setSubelementsList( $service, array( 'engineName', 'engineLink', 'homePageLink' ) );
+ ApiResult::setSubelementsList( $service, [ 'engineName', 'engineLink', 'homePageLink' ] );
ApiResult::setIndexedTagName( $service['apis'], 'api' );
$result->addValue( null, 'service', $service );
}
protected function getExamplesMessages() {
- return array(
+ return [
'action=rsd'
=> 'apihelp-rsd-example-simple',
- );
+ ];
}
public function isReadMode() {
* compatible APIs, by hooking 'ApiRsdServiceApis' and adding more
* elements to the array.
*
- * See http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html for
+ * See https://cyber.harvard.edu/blogs/gems/tech/rsd.html for
* the base RSD spec, and check WordPress and StatusNet sites for
* in-production examples listing several blogging and micrblogging
* APIs.
* @return array
*/
protected function getRsdApiList() {
- $apis = array(
- 'MediaWiki' => array(
+ $apis = [
+ 'MediaWiki' => [
// The API link is required for all RSD API entries.
'apiLink' => wfExpandUrl( wfScript( 'api' ), PROTO_CURRENT ),
'blogID' => '',
// Additional settings are optional.
- 'settings' => array(
+ 'settings' => [
// Change this to true in the future as an aid to
// machine discovery of OAuth for API access.
'OAuth' => false,
- )
- ),
- );
- Hooks::run( 'ApiRsdServiceApis', array( &$apis ) );
+ ]
+ ],
+ ];
+ Hooks::run( 'ApiRsdServiceApis', [ &$apis ] );
return $apis;
}
protected function formatRsdApiList() {
$apis = $this->getRsdApiList();
- $outputData = array();
+ $outputData = [];
foreach ( $apis as $name => $info ) {
- $data = array(
+ $data = [
'name' => $name,
'preferred' => wfBoolToStr( $name == 'MediaWiki' ),
'apiLink' => $info['apiLink'],
'blogID' => isset( $info['blogID'] ) ? $info['blogID'] : '',
- );
- $settings = array();
+ ];
+ $settings = [];
if ( isset( $info['docs'] ) ) {
$settings['docs'] = $info['docs'];
ApiResult::setSubelementsList( $settings, 'docs' );
} else {
$xmlVal = $val;
}
- $setting = array( 'name' => $setting );
+ $setting = [ 'name' => $setting ];
ApiResult::setContentValue( $setting, 'value', $xmlVal );
$settings[] = $setting;
}
return 'application/rsd+xml';
}
- public static function recXmlPrint( $name, $value, $indent, $attributes = array() ) {
+ public static function recXmlPrint( $name, $value, $indent, $attributes = [] ) {
unset( $attributes['_idx'] );
return parent::recXmlPrint( $name, $value, $indent, $attributes );
}