From 4b8523198f177820a0ff835dc1703c6ad8711dd6 Mon Sep 17 00:00:00 2001
From: Siebrand Mazeland
Date: Sun, 11 May 2014 17:34:55 +0200
Subject: [PATCH] Make phpcs-strict pass on includes/ (4/~10)
Change-Id: I2767205a7059adfb8fa090a82abd332e518f2590
---
includes/WatchedItem.php | 31 +++-
includes/WebRequest.php | 32 ++--
includes/WebStart.php | 5 +-
includes/Wiki.php | 9 +-
includes/WikiFilePage.php | 3 +-
includes/WikiPage.php | 210 ++++++++++++++-----------
includes/Xml.php | 75 ++++++---
includes/api/ApiWatch.php | 3 +-
includes/filerepo/file/LocalFile.php | 12 +-
includes/installer/PostgresUpdater.php | 3 +-
10 files changed, 251 insertions(+), 132 deletions(-)
diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php
index 9f2b498873..f69fe6334f 100644
--- a/includes/WatchedItem.php
+++ b/includes/WatchedItem.php
@@ -41,8 +41,23 @@ class WatchedItem {
*/
const CHECK_USER_RIGHTS = 1;
- var $mTitle, $mUser, $mCheckRights;
- private $loaded = false, $watched, $timestamp;
+ /** @var Title */
+ public $mTitle;
+
+ /** @var User */
+ public $mUser;
+
+ /** @var int */
+ public $mCheckRights;
+
+ /** @var bool */
+ private $loaded = false;
+
+ /** @var bool */
+ private $watched;
+
+ /** @var string */
+ private $timestamp;
/**
* Create a WatchedItem object with the given user and title
@@ -53,7 +68,9 @@ class WatchedItem {
* Pass either WatchedItem::IGNORE_USER_RIGHTS or WatchedItem::CHECK_USER_RIGHTS.
* @return WatchedItem
*/
- public static function fromUserTitle( $user, $title, $checkRights = WatchedItem::CHECK_USER_RIGHTS ) {
+ public static function fromUserTitle( $user, $title,
+ $checkRights = WatchedItem::CHECK_USER_RIGHTS
+ ) {
$wl = new WatchedItem;
$wl->mUser = $user;
$wl->mTitle = $title;
@@ -389,7 +406,13 @@ class WatchedItem {
# Perform replace
# Note that multi-row replace is very efficient for MySQL but may be inefficient for
# some other DBMSes, mostly due to poor simulation by us
- $dbw->replace( 'watchlist', array( array( 'wl_user', 'wl_namespace', 'wl_title' ) ), $values, __METHOD__ );
+ $dbw->replace(
+ 'watchlist',
+ array( array( 'wl_user', 'wl_namespace', 'wl_title' ) ),
+ $values,
+ __METHOD__
+ );
+
return true;
}
}
diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 12cf0d9f97..ac8e159be3 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -696,7 +696,9 @@ class WebRequest {
public function getRequestURL() {
if ( isset( $_SERVER['REQUEST_URI'] ) && strlen( $_SERVER['REQUEST_URI'] ) ) {
$base = $_SERVER['REQUEST_URI'];
- } elseif ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) && strlen( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
+ } elseif ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] )
+ && strlen( $_SERVER['HTTP_X_ORIGINAL_URL'] )
+ ) {
// Probably IIS; doesn't set REQUEST_URI
$base = $_SERVER['HTTP_X_ORIGINAL_URL'];
} elseif ( isset( $_SERVER['SCRIPT_NAME'] ) ) {
@@ -1010,9 +1012,9 @@ class WebRequest {
We can't serve non-HTML content from the URL you have requested, because
Internet Explorer would interpret it as an incorrect and potentially dangerous
content type.
-Instead, please use this URL, which is the same as the URL you have requested, except that
-"&*" is appended. This prevents Internet Explorer from seeing a bogus file
-extension.
+
Instead, please use this URL, which is the same as the
+URL you have requested, except that "&*" is appended. This prevents Internet
+Explorer from seeing a bogus file extension.