aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2025-04-04 00:33:13 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2025-04-04 00:33:13 +0000
commit405eecd372d267f14bc21d4e449bd5b34b461027 (patch)
treea70349526d60a3674a84b06a3352576b61119af7 /includes
parent7ce915f1c34d50be6e89c152454dad6dd2222a58 (diff)
parente60d61c4e01abb707d39ba20180bcbc09e817ac5 (diff)
downloadmediawikicore-405eecd372d267f14bc21d4e449bd5b34b461027.tar.gz
mediawikicore-405eecd372d267f14bc21d4e449bd5b34b461027.zip
Merge "Rest: Use type declaration on undocumented private functions"
Diffstat (limited to 'includes')
-rw-r--r--includes/Rest/Handler/CompareHandler.php4
-rw-r--r--includes/Rest/Handler/DiscoveryHandler.php2
-rw-r--r--includes/Rest/Handler/Helper/RestStatusTrait.php2
-rw-r--r--includes/Rest/Handler/LanguageLinksHandler.php2
-rw-r--r--includes/Rest/Handler/ModuleSpecHandler.php2
-rw-r--r--includes/Rest/Handler/PageHistoryCountHandler.php2
-rw-r--r--includes/Rest/Handler/ParsoidHandler.php2
-rw-r--r--includes/Rest/Router.php2
8 files changed, 9 insertions, 9 deletions
diff --git a/includes/Rest/Handler/CompareHandler.php b/includes/Rest/Handler/CompareHandler.php
index 2829f9f6a4cd..ce8267f8e454 100644
--- a/includes/Rest/Handler/CompareHandler.php
+++ b/includes/Rest/Handler/CompareHandler.php
@@ -111,11 +111,11 @@ class CompareHandler extends Handler {
return $rev->userCan( RevisionRecord::DELETED_TEXT, $this->getAuthority() );
}
- private function getRole() {
+ private function getRole(): string {
return SlotRecord::MAIN;
}
- private function getRevisionText( $paramName ) {
+ private function getRevisionText( string $paramName ): string {
if ( !isset( $this->textCache[$paramName] ) ) {
$revision = $this->getRevision( $paramName );
try {
diff --git a/includes/Rest/Handler/DiscoveryHandler.php b/includes/Rest/Handler/DiscoveryHandler.php
index 04fc989269ce..0a80c0b61b37 100644
--- a/includes/Rest/Handler/DiscoveryHandler.php
+++ b/includes/Rest/Handler/DiscoveryHandler.php
@@ -69,7 +69,7 @@ class DiscoveryHandler extends Handler {
];
}
- private function getInfoSpec() {
+ private function getInfoSpec(): array {
return [
'title' => $this->options->get( MainConfigNames::Sitename ),
'mediawiki' => MW_VERSION,
diff --git a/includes/Rest/Handler/Helper/RestStatusTrait.php b/includes/Rest/Handler/Helper/RestStatusTrait.php
index ec0257920430..1d19309b8cd3 100644
--- a/includes/Rest/Handler/Helper/RestStatusTrait.php
+++ b/includes/Rest/Handler/Helper/RestStatusTrait.php
@@ -37,7 +37,7 @@ trait RestStatusTrait {
throw new LocalizedHttpException( $msg, $code, $data );
}
- private function getStatusErrorKeys( StatusValue $status ) {
+ private function getStatusErrorKeys( StatusValue $status ): array {
$keys = [];
foreach ( $status->getMessages() as $msg ) {
diff --git a/includes/Rest/Handler/LanguageLinksHandler.php b/includes/Rest/Handler/LanguageLinksHandler.php
index fd63c7a5c948..400f9cd1eb40 100644
--- a/includes/Rest/Handler/LanguageLinksHandler.php
+++ b/includes/Rest/Handler/LanguageLinksHandler.php
@@ -122,7 +122,7 @@ class LanguageLinksHandler extends SimpleHandler {
->createJson( $this->fetchLinks( $page->getId() ) );
}
- private function fetchLinks( $pageId ) {
+ private function fetchLinks( int $pageId ): array {
$result = [];
$res = $this->dbProvider->getReplicaDatabase()->newSelectQueryBuilder()
->select( [ 'll_title', 'll_lang' ] )
diff --git a/includes/Rest/Handler/ModuleSpecHandler.php b/includes/Rest/Handler/ModuleSpecHandler.php
index 9025815c34b4..07ba328ea267 100644
--- a/includes/Rest/Handler/ModuleSpecHandler.php
+++ b/includes/Rest/Handler/ModuleSpecHandler.php
@@ -144,7 +144,7 @@ class ModuleSpecHandler extends SimpleHandler {
return $operationSpec;
}
- private function getComponentsSpec( Module $module ) {
+ private function getComponentsSpec( Module $module ): array {
$components = [];
// XXX: also collect reusable components from handler specs (but how to avoid name collisions?).
diff --git a/includes/Rest/Handler/PageHistoryCountHandler.php b/includes/Rest/Handler/PageHistoryCountHandler.php
index 4c8c3b6e8dae..e699ff859806 100644
--- a/includes/Rest/Handler/PageHistoryCountHandler.php
+++ b/includes/Rest/Handler/PageHistoryCountHandler.php
@@ -108,7 +108,7 @@ class PageHistoryCountHandler extends SimpleHandler {
);
}
- private function normalizeType( $type ) {
+ private function normalizeType( string $type ): string {
return self::DEPRECATED_COUNT_TYPES[$type] ?? $type;
}
diff --git a/includes/Rest/Handler/ParsoidHandler.php b/includes/Rest/Handler/ParsoidHandler.php
index 092cf92f0894..5729dd1b4bc8 100644
--- a/includes/Rest/Handler/ParsoidHandler.php
+++ b/includes/Rest/Handler/ParsoidHandler.php
@@ -648,7 +648,7 @@ abstract class ParsoidHandler extends Handler {
private function wtLint(
PageConfig $pageConfig, array $attribs, ?array $linterOverrides = []
- ) {
+ ): array {
$envOptions = $attribs['envOptions'] + [
'linterOverrides' => $linterOverrides,
'offsetType' => $attribs['offsetType'],
diff --git a/includes/Rest/Router.php b/includes/Rest/Router.php
index ff2497d6d10b..6960a07f8db5 100644
--- a/includes/Rest/Router.php
+++ b/includes/Rest/Router.php
@@ -338,7 +338,7 @@ class Router {
return $this->moduleMap;
}
- private function getModuleInfo( $module ): ?array {
+ private function getModuleInfo( string $module ): ?array {
$map = $this->getModuleMap();
return $map[$module] ?? null;
}