wiki.techinc.nl/includes/api
Bartosz Dziewoński b191e5e860 Use PHP 7 '<=>' operator in 'sort()' callbacks
`$a <=> $b` returns `-1` if `$a` is lesser, `1` if `$b` is lesser,
and `0` if they are equal, which are exactly the values 'sort()'
callbacks are supposed to return.

It also enables the neat idiom `$a[x] <=> $b[x] ?: $a[y] <=> $b[y]`
to sort arrays of objects first by 'x', and by 'y' if they are equal.

* Replace a common pattern like `return $a < $b ? -1 : 1` with the
  new operator (and similar patterns with the variables, the numbers
  or the comparison inverted). Some of the uses were previously not
  correctly handling the variables being equal; this is now
  automatically fixed.
* Also replace `return $a - $b`, which is equivalent to `return
  $a <=> $b` if both variables are integers but less intuitive.
* (Do not replace `return strcmp( $a, $b )`. It is also equivalent
  when both variables are strings, but if any of the variables is not,
  'strcmp()' converts it to a string before comparison, which could
  give different results than '<=>', so changing this would require
  careful review and isn't worth it.)
* Also replace `return $a > $b`, which presumably sort of works most
  of the time (returns `1` if `$b` is lesser, and `0` if they are
  equal or `$a` is lesser) but is erroneous.

Change-Id: I19a3d2fc8fcdb208c10330bd7a42c4e05d7f5cf3
2018-05-30 18:05:20 -07:00
..
i18n Localisation updates from https://translatewiki.net. 2018-05-29 22:01:52 +02:00
ApiAMCreateAccount.php
ApiAuthManagerHelper.php
ApiBase.php API: ApiBase::getParameter() shouldn't throw on other params' errors 2018-05-28 18:45:24 -04:00
ApiBlock.php Improve test coverage for ApiBlock.php to 100% 2018-03-26 18:17:32 +03:00
ApiChangeAuthenticationData.php
ApiCheckToken.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiClearHasMsg.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiClientLogin.php
ApiComparePages.php Fix called function case in a bunch of places 2018-01-22 09:10:09 -08:00
ApiContinuationManager.php
ApiCSPReport.php ApiCSPReport: Fix undefined $userAgent variable 2018-05-17 22:18:20 -07:00
ApiDelete.php Improve test coverage for ApiDelete.php 2018-03-26 14:36:11 +03:00
ApiDisabled.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiEditPage.php Get ~100% test coverage for ApiEditPage.php and fix a couple of bugs 2018-03-28 15:33:24 +03:00
ApiEmailUser.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiErrorFormatter.php Fix type hint in ApiErrorFormatter::addMessagesFromStatus 2018-01-09 14:01:17 +01:00
ApiExpandTemplates.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFeedContributions.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFeedRecentChanges.php Drop the 'CategorizedRecentChanges' feature 2018-02-15 10:45:10 -08:00
ApiFeedWatchlist.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFileRevert.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFormatBase.php Convert OutputHandler functions to a class 2018-03-20 21:11:32 -07:00
ApiFormatFeedWrapper.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFormatJson.php Add more checks to ApiStructureTest.php 2018-04-08 15:58:06 +03:00
ApiFormatNone.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFormatPhp.php Add more checks to ApiStructureTest.php 2018-04-08 15:58:06 +03:00
ApiFormatRaw.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiFormatXml.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiHelp.php API: Introduce "templated parameters" 2018-05-16 16:19:31 -04:00
ApiHelpParamValueMessage.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiImageRotate.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiImport.php A few doc comment fixups 2017-12-04 11:11:52 +11:00
ApiLinkAccount.php
ApiLogin.php BotPasswords: Indicate when a password needs reset 2018-05-04 09:48:23 -04:00
ApiLogout.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiMain.php API: Introduce "templated parameters" 2018-05-16 16:19:31 -04:00
ApiManageTags.php
ApiMergeHistory.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiMessage.php Split ApiMessage to class per file 2018-05-27 00:31:30 +00:00
ApiMessageTrait.php Split ApiMessage to class per file 2018-05-27 00:31:30 +00:00
ApiModuleManager.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
ApiMove.php Test ApiMove 2018-04-15 14:13:08 +03:00
ApiOpenSearch.php A few doc comment fixups 2017-12-04 11:11:52 +11:00
ApiOptions.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiPageSet.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
ApiParamInfo.php API: Introduce "templated parameters" 2018-05-16 16:19:31 -04:00
ApiParse.php Skins: getDefaultStyles can now define render blocking CSS 2018-04-26 13:00:19 -07:00
ApiPatrol.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiProtect.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiPurge.php Swap isset by null check in ApiSetNotificationTimestamp/ApiPurge 2018-04-05 12:39:24 +02:00
ApiQuery.php Rename ApiQueryContributions to ApiQueryUserContribs to match api module name 2018-05-26 23:07:15 +00:00
ApiQueryAllCategories.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryAllDeletedRevisions.php Drop archive.ar_text and ar_flags 2018-04-03 12:54:27 -04:00
ApiQueryAllImages.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiQueryAllLinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryAllMessages.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryAllPages.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryAllRevisions.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiQueryAllUsers.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiQueryAuthManagerInfo.php
ApiQueryBacklinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryBacklinksprop.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryBase.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiQueryBlocks.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiQueryCategories.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryCategoryInfo.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryCategoryMembers.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryContributors.php ApiQueryContributors: Use correct variable 2018-03-03 23:31:02 -05:00
ApiQueryDeletedRevisions.php Drop archive.ar_text and ar_flags 2018-04-03 12:54:27 -04:00
ApiQueryDeletedrevs.php Drop archive.ar_text and ar_flags 2018-04-03 12:54:27 -04:00
ApiQueryDisabled.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryDuplicateFiles.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryExternalLinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryExtLinksUsage.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryFilearchive.php Pass $key into CommentStore methods and use MediawikiServices 2018-02-05 15:34:12 +00:00
ApiQueryFileRepoInfo.php
ApiQueryGeneratorBase.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryImageInfo.php Update suppressWarning()/restoreWarning() calls 2018-02-10 08:50:12 +00:00
ApiQueryImages.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryInfo.php Add varianttitles parameter to API query prop=info 2018-04-09 22:03:19 +00:00
ApiQueryIWBacklinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryIWLinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryLangBacklinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryLangLinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryLinks.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryLogEvents.php Don't target log_user_text for registered users 2018-03-06 16:22:35 +00:00
ApiQueryMyStashedFiles.php
ApiQueryPagePropNames.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryPageProps.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryPagesWithProp.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryPrefixSearch.php
ApiQueryProtectedTitles.php Pass $key into CommentStore methods and use MediawikiServices 2018-02-05 15:34:12 +00:00
ApiQueryQueryPage.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryRandom.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryRecentChanges.php Merge "Add ability to filter based on rc_title in API" 2018-05-24 10:13:06 +00:00
ApiQueryRevisions.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiQueryRevisionsBase.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQuerySearch.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQuerySiteinfo.php Drop deprecated EnableAPI and EnableWriteAPI settings 2018-04-18 00:30:34 +00:00
ApiQueryStashImageInfo.php
ApiQueryTags.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryTokens.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryUserContribs.php Use PHP 7 '<=>' operator in 'sort()' callbacks 2018-05-30 18:05:20 -07:00
ApiQueryUserInfo.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiQueryUsers.php Pass $key into CommentStore methods and use MediawikiServices 2018-02-05 15:34:12 +00:00
ApiQueryWatchlist.php Replace rc_patrolled values with contants, part I 2018-04-11 22:35:31 +02:00
ApiQueryWatchlistRaw.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiRawMessage.php Split ApiMessage to class per file 2018-05-27 00:31:30 +00:00
ApiRemoveAuthenticationData.php
ApiResetPassword.php
ApiResult.php Use PHP 5.6 constant expressions for some bitfield constants 2018-05-30 18:05:18 -07:00
ApiRevisionDelete.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiRollback.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiRsd.php A few doc comment fixups 2017-12-04 11:11:52 +11:00
ApiSerializable.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiSetNotificationTimestamp.php Swap isset by null check in ApiSetNotificationTimestamp/ApiPurge 2018-04-05 12:39:24 +02:00
ApiSetPageLanguage.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiStashEdit.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ApiTag.php Fix inconsistent capitalization of different method calls 2017-12-27 12:35:13 +01:00
ApiTokens.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
ApiUnblock.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiUndelete.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
ApiUpload.php Use ::class to resolve class names in includes files 2018-01-27 20:34:29 +01:00
ApiUsageException.php Split ApiUsageException and UsageException to class per file 2018-05-27 20:43:55 +00:00
ApiUserrights.php API: Fix PHP Warning for "count(): Parameter must be an array" 2018-04-19 17:55:30 +00:00
ApiValidatePassword.php
ApiWatch.php Remove "Created on" from file header comments 2018-01-26 23:12:40 +00:00
IApiMessage.php Split ApiMessage to class per file 2018-05-27 00:31:30 +00:00
SearchApi.php
UsageException.php Split ApiUsageException and UsageException to class per file 2018-05-27 20:43:55 +00:00