Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402900 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: Ic8e321286c8028c60839cd97a93dbd59010ee7f7 --- M .phpcs.xml M CentralNotice.hooks.php M CentralNoticeBannerLogPager.php M CentralNoticeCampaignLogPager.php M CentralNoticePageLogPager.php M CentralNoticePager.php M api/ApiCentralNoticeCdnCacheUpdateBanner.php M api/ApiCentralNoticeLogs.php M api/ApiCentralNoticeQueryCampaign.php M includes/AllocationCalculator.php M includes/Banner.php M includes/BannerMessage.php M includes/BannerMessageGroup.php M includes/BannerRenderer.php M includes/CNBannerPager.php M includes/CNCampaignPager.php M includes/CNChoiceDataResourceLoaderModule.php M includes/Campaign.php M includes/ChoiceDataProvider.php M includes/HtmlFormElements/HTMLCentralNoticeBanner.php M includes/HtmlFormElements/HTMLCentralNoticeBannerMessage.php M includes/IBannerMixin.php M special/SpecialBannerAllocation.php M special/SpecialBannerRandom.php M special/SpecialCentralNotice.php M special/SpecialCentralNoticeLogs.php M special/SpecialGlobalAllocation.php M special/SpecialHideBanners.php M special/SpecialNoticeTemplate.php M tests/CNTestFixturesResourceLoaderModule.php M tests/CentralNoticeTestFixtures.php 31 files changed, 125 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/00/402900/1 diff --git a/.phpcs.xml b/.phpcs.xml index 9d96d27..114efbc 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -5,8 +5,6 @@ <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> diff --git a/CentralNotice.hooks.php b/CentralNotice.hooks.php index 7a0a930..84315da 100644 --- a/CentralNotice.hooks.php +++ b/CentralNotice.hooks.php @@ -100,6 +100,8 @@ /** * Tell the UserMerge extension where we store user ids + * @param array[] &$updateFields + * @return true */ public static function onUserMergeAccountFields( &$updateFields ) { global $wgNoticeInfrastructure; diff --git a/CentralNoticeBannerLogPager.php b/CentralNoticeBannerLogPager.php index 01a078d..15e90bf 100644 --- a/CentralNoticeBannerLogPager.php +++ b/CentralNoticeBannerLogPager.php @@ -10,6 +10,7 @@ /** * Sort the log list by timestamp + * @return string */ function getIndexField() { return 'tmplog_timestamp'; @@ -17,6 +18,7 @@ /** * Pull log entries from the database + * @return array */ function getQueryInfo() { return [ @@ -27,6 +29,8 @@ /** * Generate the content of each table row (1 row = 1 log entry) + * @param stdClass $row + * @return string HTML */ function formatRow( $row ) { global $wgExtensionAssetsPath; diff --git a/CentralNoticeCampaignLogPager.php b/CentralNoticeCampaignLogPager.php index f47b705..21e8e86 100644 --- a/CentralNoticeCampaignLogPager.php +++ b/CentralNoticeCampaignLogPager.php @@ -16,6 +16,7 @@ /** * Sort the log list by timestamp + * @return string */ function getIndexField() { return 'notlog_timestamp'; @@ -23,6 +24,7 @@ /** * Pull log entries from the database + * @return array[] */ function getQueryInfo() { $request = $this->getRequest(); @@ -74,6 +76,8 @@ /** * Generate the content of each table row (1 row = 1 log entry) + * @param stdClass $row + * @return string HTML */ function formatRow( $row ) { global $wgExtensionAssetsPath; @@ -504,6 +508,7 @@ /** * Specify table headers + * @return string HTML */ function getStartBody() { $htmlOut = ''; @@ -534,6 +539,7 @@ /** * Close table + * @return strint HTML */ function getEndBody() { $htmlOut = ''; diff --git a/CentralNoticePageLogPager.php b/CentralNoticePageLogPager.php index 914daa7..b8417ee 100644 --- a/CentralNoticePageLogPager.php +++ b/CentralNoticePageLogPager.php @@ -23,6 +23,7 @@ /** * Sort the log list by timestamp + * @return string */ function getIndexField() { return 'rc_timestamp'; @@ -30,6 +31,7 @@ /** * Pull log entries from the database + * @return array[] */ function getQueryInfo() { $conds = [ @@ -77,6 +79,8 @@ /** * Generate the content of each table row (1 row = 1 log entry) + * @param stdClass $row + * @return string HTML */ function formatRow( $row ) { // Create a user object so we can pull the name, user page, etc. diff --git a/CentralNoticePager.php b/CentralNoticePager.php index 5d8e7b3..a18436b 100644 --- a/CentralNoticePager.php +++ b/CentralNoticePager.php @@ -11,6 +11,7 @@ /** * Pull banners from the database + * @return array[] */ function getQueryInfo() { $dbr = CNDatabase::getDb(); @@ -74,6 +75,8 @@ /** * Generate the content of each table row (1 row = 1 banner) + * @param stdClass $row + * @return string HTML */ function formatRow( $row ) { // Begin banner row diff --git a/api/ApiCentralNoticeCdnCacheUpdateBanner.php b/api/ApiCentralNoticeCdnCacheUpdateBanner.php index ebd2ac8..361435b 100644 --- a/api/ApiCentralNoticeCdnCacheUpdateBanner.php +++ b/api/ApiCentralNoticeCdnCacheUpdateBanner.php @@ -8,7 +8,7 @@ class ApiCentralNoticeCdnCacheUpdateBanner extends ApiBase { /** - * @see ApiBase::execute() + * @inheritDoc */ public function execute() { $params = $this->extractRequestParams(); @@ -43,7 +43,7 @@ } /** - * @see ApiBase::getAllowedParams() + * @inheritDoc */ public function getAllowedParams() { return [ @@ -59,14 +59,14 @@ } /** - * @see ApiBase::needsToken() + * @inheritDoc */ public function needsToken() { return 'csrf'; } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/ApiCentralNoticeLogs.php b/api/ApiCentralNoticeLogs.php index a2805e3..0972833 100644 --- a/api/ApiCentralNoticeLogs.php +++ b/api/ApiCentralNoticeLogs.php @@ -57,7 +57,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/ApiCentralNoticeQueryCampaign.php b/api/ApiCentralNoticeQueryCampaign.php index 0d11364..47779d1 100644 --- a/api/ApiCentralNoticeQueryCampaign.php +++ b/api/ApiCentralNoticeQueryCampaign.php @@ -47,7 +47,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/includes/AllocationCalculator.php b/includes/AllocationCalculator.php index c3c8bf9..8648c2c 100644 --- a/includes/AllocationCalculator.php +++ b/includes/AllocationCalculator.php @@ -314,6 +314,8 @@ } /** + * @param string $s + * @return int * @throws InvalidArgumentException */ public static function getLoggedInStatusFromString( $s ) { diff --git a/includes/Banner.php b/includes/Banner.php index a2c6ffd..888152f 100644 --- a/includes/Banner.php +++ b/includes/Banner.php @@ -357,6 +357,7 @@ /** * Sets the flag which will save basic metadata on next save() + * @param bool $dirty */ protected function setBasicDataDirty( $dirty = true ) { $this->dirtyFlags['basic'] = $dirty; @@ -477,6 +478,7 @@ /** * Sets the flag which will force saving of device targeting data on next save() + * @param bool $dirty */ protected function markDeviceTargetDataDirty( $dirty = true ) { $this->dirtyFlags['devices'] = $dirty; @@ -585,6 +587,7 @@ /** * Sets the flag which will force saving of mixin data upon next save() + * @param bool $dirty */ protected function markMixinDataDirty( $dirty = true ) { $this->dirtyFlags['mixins'] = $dirty; @@ -1315,6 +1318,8 @@ /** * FIXME: a little thin, it's just enough to get the job done * + * @param string $name + * @param int $ts * @return array|null banner settings as an associative array, with these properties: * display_anon: 0/1 whether the banner is displayed to anonymous users * display_account: 0/1 same, for logged-in users diff --git a/includes/BannerMessage.php b/includes/BannerMessage.php index 62d0eb5..dbfd5c9 100644 --- a/includes/BannerMessage.php +++ b/includes/BannerMessage.php @@ -40,6 +40,8 @@ /** * Return the whether the message exists, without language fallback. + * @param string|null $lang + * @return bool */ function existsInLang( $lang ) { return $this->getTitle( $lang )->exists(); @@ -48,6 +50,7 @@ /** * Obtain the raw contents of the message; stripping out the stupid <message-name> if it's blank * + * @param null|string $lang * @return null|string Will be null if the message does not exist, otherwise will be * the contents of the message. */ @@ -86,6 +89,10 @@ /** * Add or update message contents + * @param string $translation + * @param string|null $lang + * @param User $user + * @param string|null $summary */ function update( $translation, $lang, $user, $summary = null ) { global $wgNoticeUseTranslateExtension, $wgLanguageCode; diff --git a/includes/BannerMessageGroup.php b/includes/BannerMessageGroup.php index f1d02e0..276dff6 100644 --- a/includes/BannerMessageGroup.php +++ b/includes/BannerMessageGroup.php @@ -12,8 +12,6 @@ protected $namespace = NS_CN_BANNER; /** - * Constructor. - * * @param int $namespace ID of the namespace holding CentralNotice messages * @param string $title The page name of the CentralNotice banner */ @@ -89,6 +87,7 @@ /** * Determine if the CentralNotice banner group is using the group review feature of translate + * @return bool */ static function isUsingGroupReview() { static $useGroupReview = null; diff --git a/includes/BannerRenderer.php b/includes/BannerRenderer.php index df2851b..5130076 100644 --- a/includes/BannerRenderer.php +++ b/includes/BannerRenderer.php @@ -172,6 +172,7 @@ * * This is only used internally, and will be parsed for magic words * before use. + * @return string */ function getPreloadJsRaw() { $snippets = $this->mixinController->getPreloadJsSnippets(); diff --git a/includes/CNBannerPager.php b/includes/CNBannerPager.php index 5fb8cbe..e979b93 100644 --- a/includes/CNBannerPager.php +++ b/includes/CNBannerPager.php @@ -201,7 +201,7 @@ /** * Make a self-link. Overriding to add filter as a query parameter. - * @see Pager::makeLink() + * @inheritDoc */ public function makeLink( $text, array $query = null, $type = null ) { $filterQuery = $this->hostSpecialPage->getFilterUrlParamAsArray(); @@ -214,8 +214,8 @@ } class HTMLBannerPagerNavigation extends HTMLFormField { - /** Empty - no validation can be done on a navigation element */ function validate( $value, $alldata ) { + // Empty - no validation can be done on a navigation element return true; } diff --git a/includes/CNCampaignPager.php b/includes/CNCampaignPager.php index a12de79..d0fad22 100644 --- a/includes/CNCampaignPager.php +++ b/includes/CNCampaignPager.php @@ -53,7 +53,7 @@ } /** - * @see IndexPager::getQueryInfo() + * @inheritDoc */ public function getQueryInfo() { $pagerQuery = [ @@ -117,7 +117,7 @@ } /** - * @see TablePager::getFieldNames() + * @inheritDoc */ public function getFieldNames() { if ( !$this->fieldNames ) { @@ -140,7 +140,7 @@ } /** - * @see TablePager::getStartBody() + * @inheritDoc */ public function getStartBody() { $htmlOut = ''; @@ -280,7 +280,7 @@ /** * Set special CSS classes for active and archived campaigns. * - * @see TablePager::getRowClass() + * @inheritDoc */ public function getRowClass( $row ) { $enabled = ( $row->not_enabled == '1' ); @@ -304,7 +304,7 @@ } /** - * @see TablePager::getCellAttrs() + * @inheritDoc */ public function getCellAttrs( $field, $value ) { $attrs = parent::getCellAttrs( $field, $value ); @@ -332,7 +332,7 @@ } /** - * @see TablePager::getEndBody() + * @inheritDoc */ public function getEndBody() { $htmlOut = ''; @@ -363,7 +363,7 @@ } /** - * @see TablePager::isFieldSortable() + * @inheritDoc */ public function isFieldSortable( $field ) { // If this is the only page shown, we'll sort via JS, which works on all @@ -388,7 +388,7 @@ } /** - * @see TablePager::getDefaultSort() + * @inheritDoc */ public function getDefaultSort() { return $this->assignedBannerId === null ? @@ -397,13 +397,14 @@ /** * Returns true if this is the only page of results there is to show. + * @return bool */ protected function isWithinLimit() { return $this->mIsFirst && $this->mIsLast; } /** - * @see IndexPager::extractResultInfo() + * @inheritDoc */ function extractResultInfo( $isFirst, $limit, ResultWrapper $res ) { parent::extractResultInfo( $isFirst, $limit, $res ); @@ -416,7 +417,7 @@ } /** - * @see TablePager::getTableClass() + * @inheritDoc */ public function getTableClass() { $jsSortable = $this->isWithinLimit() ? ' sortable' : ''; diff --git a/includes/CNChoiceDataResourceLoaderModule.php b/includes/CNChoiceDataResourceLoaderModule.php index 99e0a6e..bbcddda 100644 --- a/includes/CNChoiceDataResourceLoaderModule.php +++ b/includes/CNChoiceDataResourceLoaderModule.php @@ -91,7 +91,7 @@ } /** - * @see ResourceLoaderModule::getScript() + * @inheritDoc */ public function getScript( ResourceLoaderContext $context ) { $choices = $this->getChoices( $context ); @@ -117,7 +117,7 @@ } /** - * @see ResourceLoaderModule::getDependencies() + * @inheritDoc * Note: requires mediawiki-core change-id @Iee61e5b52 */ public function getDependencies( ResourceLoaderContext $context = null ) { @@ -160,7 +160,7 @@ } /** - * @see ResourceLoaderModule::getDefinitionSummary() + * @inheritDoc */ public function getDefinitionSummary( ResourceLoaderContext $context ) { $summary = parent::getDefinitionSummary( $context ); diff --git a/includes/Campaign.php b/includes/Campaign.php index 26466bd..aa9918c 100644 --- a/includes/Campaign.php +++ b/includes/Campaign.php @@ -435,6 +435,7 @@ /** * Get all campaign configurations as of timestamp $ts * + * @param int $ts * @return array of settings structs having the following properties: * id * name @@ -1008,6 +1009,8 @@ /** * Remove a banner assignment from a campaign + * @param string $noticeName + * @param string $templateName */ static function removeTemplateFor( $noticeName, $templateName ) { $dbw = CNDatabase::getDb( DB_MASTER ); @@ -1034,6 +1037,8 @@ /** * Lookup the name of a campaign based on the campaign ID + * @param int $noticeId + * @return null|string */ static function getNoticeName( $noticeId ) { $dbr = CNDatabase::getDb(); diff --git a/includes/ChoiceDataProvider.php b/includes/ChoiceDataProvider.php index 2bf7981..dc04ed6 100644 --- a/includes/ChoiceDataProvider.php +++ b/includes/ChoiceDataProvider.php @@ -14,6 +14,7 @@ /** * Invalidate the shared global cache. + * @return bool */ public static function invalidateCache() { $cache = ObjectCache::getMainWANInstance(); diff --git a/includes/HtmlFormElements/HTMLCentralNoticeBanner.php b/includes/HtmlFormElements/HTMLCentralNoticeBanner.php index 415fb0c..4e30b27 100644 --- a/includes/HtmlFormElements/HTMLCentralNoticeBanner.php +++ b/includes/HtmlFormElements/HTMLCentralNoticeBanner.php @@ -33,12 +33,16 @@ * - 'withlabel' - Presence of this attribute causes a label to be shown */ class HTMLCentralNoticeBanner extends HTMLInfoField { - /** Empty - no validation can be done on a banner */ function validate( $value, $alldata ) { + // Empty - no validation can be done on a banner return true; } - /** Get a preview of the banner */ + /** + * Get a preview of the banner + * @param string $value + * @return string HTML + */ public function getInputHTML( $value ) { global $wgOut, $wgNoticeBannerPreview; diff --git a/includes/HtmlFormElements/HTMLCentralNoticeBannerMessage.php b/includes/HtmlFormElements/HTMLCentralNoticeBannerMessage.php index 80644ff..4f66e7d 100644 --- a/includes/HtmlFormElements/HTMLCentralNoticeBannerMessage.php +++ b/includes/HtmlFormElements/HTMLCentralNoticeBannerMessage.php @@ -43,12 +43,16 @@ parent::__construct( $params ); } - /** Empty - no validation can be done on a banner message */ function validate( $value, $alldata ) { + // Empty - no validation can be done on a banner message return true; } - /** Get a preview of the banner message */ + /** + * Get a preview of the banner message + * @param string $value + * @return string HTML + */ public function getInputHTML( $value ) { global $wgContLang; diff --git a/includes/IBannerMixin.php b/includes/IBannerMixin.php index e75828f..ae8e845 100644 --- a/includes/IBannerMixin.php +++ b/includes/IBannerMixin.php @@ -7,6 +7,7 @@ /** * Initialize the module. At the moment, the only action which would * be taken through the controller is to declare magic words. + * @param MixinController $controller */ function register( MixinController $controller ); } diff --git a/special/SpecialBannerAllocation.php b/special/SpecialBannerAllocation.php index 98a2223..1f94f85 100644 --- a/special/SpecialBannerAllocation.php +++ b/special/SpecialBannerAllocation.php @@ -49,9 +49,6 @@ */ public $location = 'US'; - /** - * Constructor - */ public function __construct() { // Register special page SpecialPage::__construct( 'BannerAllocation' ); @@ -63,6 +60,7 @@ /** * Handle different types of page requests + * @param string|null $sub */ public function execute( $sub ) { global $wgNoticeProjects, $wgLanguageCode, $wgNoticeProject; diff --git a/special/SpecialBannerRandom.php b/special/SpecialBannerRandom.php index 672bac4..c8c0073 100644 --- a/special/SpecialBannerRandom.php +++ b/special/SpecialBannerRandom.php @@ -12,6 +12,7 @@ /** * This endpoint is deprecated. + * @param string|null $par */ function execute( $par ) { $this->getOutput()->disable(); diff --git a/special/SpecialCentralNotice.php b/special/SpecialCentralNotice.php index efb5ab2..591e384 100644 --- a/special/SpecialCentralNotice.php +++ b/special/SpecialCentralNotice.php @@ -28,6 +28,7 @@ /** * Handle different types of page requests + * @param string|null $sub */ function execute( $sub ) { // Begin output @@ -193,6 +194,10 @@ /** * Render a field suitable for jquery.ui datepicker + * @param string $name + * @param bool $editable + * @param string|null $timestamp + * @return string */ protected function dateSelector( $name, $editable, $timestamp = null ) { if ( $editable ) { @@ -443,6 +448,8 @@ /** * Retrieve jquery.ui.datepicker date and homebrew time, * and return as a MW timestamp string. + * @param string $prefix + * @return null|string */ function getDateTime( $prefix ) { global $wgRequest; @@ -799,6 +806,8 @@ /** * Create form for managing campaign settings (start date, end date, languages, etc.) + * @param string $notice + * @return string HTML */ function noticeDetailForm( $notice ) { global $wgNoticeNumberOfBuckets, $wgCentralNoticeCampaignMixins; @@ -1053,6 +1062,8 @@ * * Common campaign misconfigurations will cause warnings to appear * at the top of this form. + * @param string $notice + * @return string HTML */ function assignedTemplatesForm( $notice ) { global $wgNoticeNumberOfBuckets; @@ -1520,6 +1531,8 @@ /** * Truncate the summary field in a linguistically appropriate way. + * @param string $summary + * @return string */ public static function truncateSummaryField( $summary ) { global $wgContLang; diff --git a/special/SpecialCentralNoticeLogs.php b/special/SpecialCentralNoticeLogs.php index f761f62..2f26cb0 100644 --- a/special/SpecialCentralNoticeLogs.php +++ b/special/SpecialCentralNoticeLogs.php @@ -14,6 +14,7 @@ /** * Handle different types of page requests + * @param string|null $sub */ function execute( $sub ) { global $wgExtensionAssetsPath; @@ -203,6 +204,10 @@ /** * Render a field suitable for jquery.ui datepicker + * @param string $prefix + * @param bool $editable + * @param string $date + * @return string HTML */ protected function dateSelector( $prefix, $editable = true, $date = '' ) { $out = Html::element( 'input', @@ -263,6 +268,8 @@ /** * Returns the jquery.ui datepicker value, or null if the field is blank. + * @param string $name + * @return null|string */ public function getDateValue( $name ) { $manual_entry = $this->getRequest()->getVal( "{$name}Date" ); diff --git a/special/SpecialGlobalAllocation.php b/special/SpecialGlobalAllocation.php index 36ca7ab..e2cc4dc 100644 --- a/special/SpecialGlobalAllocation.php +++ b/special/SpecialGlobalAllocation.php @@ -95,6 +95,7 @@ * Handle page requests * * Without filters, this will display the allocation of all active banners. + * @param string|null $sub */ public function execute( $sub ) { global $wgNoticeProjects, $wgLanguageCode; @@ -339,6 +340,7 @@ * and Dx,y = ({a}, {1, 3}). The intersection will be CDx,y = ({a}, {1}), * and to represent the remaining grouping C-CD will take two cross-product * rows: Cx,y = ({a}, {2}) + ({b}, {1, 2}). + * @return array[] */ protected function analyzeGroupings() { $groupings = []; @@ -418,6 +420,9 @@ * Return every (unordered) combination of $num elements from $list * TODO: don't use recursion. * + * @param array $list + * @param int $num + * @return array[] * @throws InvalidArgumentException */ protected static function makeCombinations( array $list, $num ) { @@ -558,6 +563,12 @@ /** * Print one line of banner allocations. + * @param array $banner + * @param bool $variesAnon + * @param bool $variesBucket + * @param bool $isAnon + * @param string $bucket + * @return string HTML */ function getBannerAllocationsVariantRow( $banner, $variesAnon, $variesBucket, $isAnon, $bucket @@ -635,10 +646,11 @@ /** * Filter campaigns using criteria provided. * - * @param array $campaigns campaings to filter + * @param array[] $campaigns campaings to filter * @param string $country * @param string $language * @param string $project + * @return array[] */ protected static function filterCampaigns( $campaigns, $country, $language, $project @@ -692,8 +704,9 @@ * Taking multiple criteria as an argument helps us do an array_reduce-- * The result of a subtraction is usually multiple disjoint sets. * - * @param array $rows array of CampaignCriteria + * @param array[] $rows array of CampaignCriteria * @param array $b single CampaignCriteria + * @return array[] */ public static function difference( $rows, $b ) { if ( !$b ) { diff --git a/special/SpecialHideBanners.php b/special/SpecialHideBanners.php index 11739e4..c4d8ff2 100644 --- a/special/SpecialHideBanners.php +++ b/special/SpecialHideBanners.php @@ -59,6 +59,9 @@ /** * Set the cookie for hiding fundraising banners. + * @param string $category + * @param int $duration + * @param string $reason */ function setHideCookie( $category, $duration, $reason ) { global $wgNoticeCookieDomain; diff --git a/special/SpecialNoticeTemplate.php b/special/SpecialNoticeTemplate.php index 98f8d2e..a95d102 100644 --- a/special/SpecialNoticeTemplate.php +++ b/special/SpecialNoticeTemplate.php @@ -14,6 +14,7 @@ /** * Handle different types of page requests + * @param string|null $sub */ public function execute( $sub ) { if ( $sub == 'view' ) { diff --git a/tests/CNTestFixturesResourceLoaderModule.php b/tests/CNTestFixturesResourceLoaderModule.php index 474e135..b5e0e52 100644 --- a/tests/CNTestFixturesResourceLoaderModule.php +++ b/tests/CNTestFixturesResourceLoaderModule.php @@ -7,11 +7,12 @@ * QUnitTestResources). * * @see ResourceLoaderModule::targets + * @var string[] */ protected $targets = [ 'desktop', 'mobile' ]; /** - * @see ResourceLoaderModule::getScript() + * @inheritDoc */ public function getScript( ResourceLoaderContext $context ) { return 'mediaWiki.centralNoticeTestFixtures = ' . diff --git a/tests/CentralNoticeTestFixtures.php b/tests/CentralNoticeTestFixtures.php index 56640f4..678e226 100644 --- a/tests/CentralNoticeTestFixtures.php +++ b/tests/CentralNoticeTestFixtures.php @@ -57,6 +57,7 @@ /** * Get an associative array with data for setting mock global variables * as appropriate for fixture data. + * @return array */ function getGlobalsFromFixtureData() { $data = self::allocationsData(); @@ -345,6 +346,7 @@ * @param MediaWikiTestCase $testClass * @param array $expected Expected choices data structure * @param array $actual Actual choices data structure + * @param string $message */ function assertChoicesEqual( MediaWikiTestCase $testClass, $expected, $actual, $message = '' @@ -362,6 +364,7 @@ * structure, numerically indexed arrays are sorted by value. * (If $a is a numerically indexed array, sort it by value. Traverse the * array recursively and do the same for each value.) + * @param array &$a */ protected function deepMultisort( array &$a ) { array_multisort( $a ); @@ -416,6 +419,7 @@ * Return an array containing arrays containing test cases, as needed for * PHPUnit data provision. (Each inner array is a list of arguments for * a test method.) + * @return array[] */ public static function allocationsTestCasesProvision() { $data = self::allocationsData(); @@ -431,6 +435,7 @@ /** * Return allocations data as a PHP array where each element is a different * scenario for testing. + * @return array */ public static function allocationsData() { $json = self::allocationsDataAsJson(); @@ -441,6 +446,7 @@ /** * Return the raw JSON allocations data (from the file indicated by * CentralNoticeTestFixtures::FIXTURE_RELATIVE_PATH). + * @return string */ public static function allocationsDataAsJson() { $path = __DIR__ . '/' . self::FIXTURE_RELATIVE_PATH; -- To view, visit https://gerrit.wikimedia.org/r/402900 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8e321286c8028c60839cd97a93dbd59010ee7f7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits