[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[master]: Use short array syntax - api / tests

2017-06-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/358051 )

Change subject: Use short array syntax - api / tests
..


Use short array syntax - api / tests

Done by phpcbf over composer fix

Change-Id: I0e23bb8eee6d123b6a2609623b91b9f2342760e4
---
M api/ApiCentralNoticeChoiceData.php
M api/ApiCentralNoticeLogs.php
M api/ApiCentralNoticeQueryCampaign.php
M tests/ApiCentralNoticeChoiceDataTest.php
M tests/BannerTest.php
M tests/CNChoiceDataResourceLoaderModuleTest.php
M tests/CNTestFixturesResourceLoaderModule.php
M tests/CentralNoticeTest.php
M tests/CentralNoticeTestFixtures.php
M tests/HistoryTest.php
10 files changed, 102 insertions(+), 102 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved



diff --git a/api/ApiCentralNoticeChoiceData.php 
b/api/ApiCentralNoticeChoiceData.php
index a552def..0c01747 100644
--- a/api/ApiCentralNoticeChoiceData.php
+++ b/api/ApiCentralNoticeChoiceData.php
@@ -50,23 +50,23 @@
}
 
public function getAllowedParams() {
-   return array(
-   'project' => array(
+   return [
+   'project' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
-   ),
-   'language' => array(
+   ],
+   'language' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
-   )
-   );
+   ]
+   ];
}
 
protected function getExamplesMessages() {
-   return array(
+   return [

'action=centralnoticechoicedata=wikipedia=en'
=> 'apihelp-centralnoticechoicedata-example-1'
-   );
+   ];
}
 
/**
@@ -80,7 +80,7 @@
 * @return string The sanitized value
 */
protected static function sanitizeText( $param, $regex, $default = null 
) {
-   $matches = array();
+   $matches = [];
 
if ( preg_match( $regex, $param, $matches ) ) {
return $matches[ 0 ];
diff --git a/api/ApiCentralNoticeLogs.php b/api/ApiCentralNoticeLogs.php
index 77d2036..424311f 100644
--- a/api/ApiCentralNoticeLogs.php
+++ b/api/ApiCentralNoticeLogs.php
@@ -26,45 +26,45 @@
 
$logs = Campaign::campaignLogs( $campaign, $user, $start, $end, 
$limit, $offset );
 
-   $result->addValue( array( 'query', $this->getModuleName() ), 
'logs', $logs );
+   $result->addValue( [ 'query', $this->getModuleName() ], 'logs', 
$logs );
}
 
public function getAllowedParams() {
-   return array(
-   'campaign' => array(
+   return [
+   'campaign' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'user' => array(
+   ],
+   'user' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'limit' => array(
+   ],
+   'limit' => [
ApiBase::PARAM_DFLT => 50,
ApiBase::PARAM_TYPE => 'limit',
ApiBase::PARAM_MIN  => 1,
ApiBase::PARAM_MAX  => ApiBase::LIMIT_BIG1,
ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
-   ),
-   'offset' => array(
+   ],
+   'offset' => [
ApiBase::PARAM_DFLT => 0,
ApiBase::PARAM_TYPE => 'integer',
-   ),
-   'start' => array(
+   ],
+   'start' => [
ApiBase::PARAM_TYPE => 'timestamp',
-   ),
-   'end' => array(
+   ],
+   'end' => [
ApiBase::PARAM_TYPE => 'timestamp',
-   ),
-   );
+   ],
+   ];
}
 
/**
 * @see ApiBase::getExamplesMessages()
 */
protected function getExamplesMessages() {
-   return array(
+   return [
'action=query=centralnoticelogs=json'
=> 'apihelp-query+centralnoticelogs-example-1',
-

[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[master]: Use short array syntax - api / tests

2017-06-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/358051 )

Change subject: Use short array syntax - api / tests
..

Use short array syntax - api / tests

Change-Id: I0e23bb8eee6d123b6a2609623b91b9f2342760e4
---
M api/ApiCentralNoticeChoiceData.php
M api/ApiCentralNoticeLogs.php
M api/ApiCentralNoticeQueryCampaign.php
M tests/ApiCentralNoticeChoiceDataTest.php
M tests/BannerTest.php
M tests/CNChoiceDataResourceLoaderModuleTest.php
M tests/CNTestFixturesResourceLoaderModule.php
M tests/CentralNoticeTest.php
M tests/CentralNoticeTestFixtures.php
M tests/HistoryTest.php
10 files changed, 102 insertions(+), 102 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/51/358051/1

diff --git a/api/ApiCentralNoticeChoiceData.php 
b/api/ApiCentralNoticeChoiceData.php
index a552def..0c01747 100644
--- a/api/ApiCentralNoticeChoiceData.php
+++ b/api/ApiCentralNoticeChoiceData.php
@@ -50,23 +50,23 @@
}
 
public function getAllowedParams() {
-   return array(
-   'project' => array(
+   return [
+   'project' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
-   ),
-   'language' => array(
+   ],
+   'language' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
-   )
-   );
+   ]
+   ];
}
 
protected function getExamplesMessages() {
-   return array(
+   return [

'action=centralnoticechoicedata=wikipedia=en'
=> 'apihelp-centralnoticechoicedata-example-1'
-   );
+   ];
}
 
/**
@@ -80,7 +80,7 @@
 * @return string The sanitized value
 */
protected static function sanitizeText( $param, $regex, $default = null 
) {
-   $matches = array();
+   $matches = [];
 
if ( preg_match( $regex, $param, $matches ) ) {
return $matches[ 0 ];
diff --git a/api/ApiCentralNoticeLogs.php b/api/ApiCentralNoticeLogs.php
index 6176121..083adbd 100644
--- a/api/ApiCentralNoticeLogs.php
+++ b/api/ApiCentralNoticeLogs.php
@@ -26,45 +26,45 @@
 
$logs = Campaign::campaignLogs( $campaign, $user, $start, $end, 
$limit, $offset );
 
-   $result->addValue( array( 'query', $this->getModuleName() ), 
'logs', $logs );
+   $result->addValue( [ 'query', $this->getModuleName() ], 'logs', 
$logs );
}
 
public function getAllowedParams() {
-   return array(
-   'campaign' => array(
+   return [
+   'campaign' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'user' => array(
+   ],
+   'user' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'limit' => array(
+   ],
+   'limit' => [
ApiBase::PARAM_DFLT => 50,
ApiBase::PARAM_TYPE => 'limit',
ApiBase::PARAM_MIN  => 1,
ApiBase::PARAM_MAX  => ApiBase::LIMIT_BIG1,
ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
-   ),
-   'offset' => array(
+   ],
+   'offset' => [
ApiBase::PARAM_DFLT => 0,
ApiBase::PARAM_TYPE => 'integer',
-   ),
-   'start' => array(
+   ],
+   'start' => [
ApiBase::PARAM_TYPE => 'timestamp',
-   ),
-   'end' => array(
+   ],
+   'end' => [
ApiBase::PARAM_TYPE => 'timestamp',
-   ),
-   );
+   ],
+   ];
}
 
/**
 * @see ApiBase::getExamplesMessages()
 */
protected function getExamplesMessages() {
-   return array(
+   return [
'action=query=centralnoticelogs=json'
=> 'apihelp-query+centralnoticelogs-example-1',
-   );
+   ];
}
 
/**
@@ -78,7 +78,7