aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Rest/Handler
diff options
context:
space:
mode:
Diffstat (limited to 'includes/Rest/Handler')
-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
7 files changed, 8 insertions, 8 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'],