Remove empty lines at begin of function, if, foreach, switch

Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
This commit is contained in:
Umherirrender 2017-07-01 10:32:08 +02:00
parent c47221ab82
commit b5cddfb27b
129 changed files with 108 additions and 287 deletions

View file

@ -74,9 +74,7 @@ Using a hook-running strategy, we can avoid having all this option-specific
stuff in our mainline code. Using hooks, the function becomes:
function showAnArticle( $article ) {
if ( Hooks::run( 'ArticleShow', array( &$article ) ) ) {
# code to actually show the article goes here
Hooks::run( 'ArticleShowComplete', array( &$article ) );

View file

@ -829,7 +829,6 @@ class Block {
* @return bool
*/
public function deleteIfExpired() {
if ( $this->isExpired() ) {
wfDebug( "Block::deleteIfExpired() -- deleting\n" );
$this->delete();
@ -1111,7 +1110,6 @@ class Block {
* not be the same as the target you gave if you used $vagueTarget!
*/
public static function newFromTarget( $specificTarget, $vagueTarget = null, $fromMaster = false ) {
list( $target, $type ) = self::parseTarget( $specificTarget );
if ( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ) {
return Block::newFromID( $target );

View file

@ -269,7 +269,6 @@ class Category {
* @return TitleArray TitleArray object for category members.
*/
public function getMembers( $limit = false, $offset = '' ) {
$dbr = wfGetDB( DB_REPLICA );
$conds = [ 'cl_to' => $this->getName(), 'cl_from = page_id' ];

View file

@ -186,7 +186,6 @@ class CategoryFinder {
* Scans a "parent layer" of the articles/categories in $this->next
*/
private function scanNextLayer() {
# Find all parents of the article currently in $this->next
$layer = [];
$res = $this->dbr->select(

View file

@ -108,7 +108,6 @@ class CategoryViewer extends ContextSource {
* @return string HTML output
*/
public function getHTML() {
$this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' )
&& !$this->getOutput()->mNoGallery;

View file

@ -38,7 +38,6 @@ class DeprecatedGlobal extends StubObject {
// PSR2.Methods.MethodDeclaration.Underscore
// PSR2.Classes.PropertyDeclaration.ScopeMissing
function _newObject() {
/* Put the caller offset for wfDeprecated as 6, as
* that gives the function that uses this object, since:
* 1 = this function ( _newObject )

View file

@ -188,7 +188,6 @@ class FeedUtils {
}
if ( $html === null ) {
// Omit large new page diffs, T31110
// Also use diff link for non-textual content
$diffText = self::getDiffLink( $title, $newid );

View file

@ -1882,7 +1882,6 @@ class Linker {
* @return string HTML output
*/
public static function formatHiddenCategories( $hiddencats ) {
$outText = '';
if ( count( $hiddencats ) > 0 ) {
# Construct the HTML

View file

@ -821,7 +821,6 @@ class MediaWiki {
// ATTENTION: This hook is likely to be removed soon due to overall design of the system.
if ( Hooks::run( 'BeforeHttpsRedirect', [ $this->context, &$redirUrl ] ) ) {
if ( $request->wasPosted() ) {
// This is weird and we'd hope it almost never happens. This
// means that a POST came in via HTTP and policy requires us

View file

@ -440,8 +440,8 @@ class MovePage {
* @throws MWException
*/
private function moveToInternal( User $user, &$nt, $reason = '', $createRedirect = true,
array $changeTags = [] ) {
array $changeTags = []
) {
global $wgContLang;
if ( $nt->exists() ) {
$moveOverRedirect = true;

View file

@ -183,7 +183,6 @@ function wfDoContentLength( $length ) {
* @return string
*/
function wfHtmlValidationHandler( $s ) {
$errors = '';
if ( MWTidy::checkErrors( $s, $errors ) ) {
return $s;

View file

@ -906,7 +906,6 @@ class Sanitizer {
* @return string normalized css
*/
public static function normalizeCss( $value ) {
// Decode character references like {
$value = Sanitizer::decodeCharReferences( $value );

View file

@ -3735,8 +3735,8 @@ class Title implements LinkTarget {
* @return array|bool True on success, getUserPermissionsErrors()-like array on failure
*/
public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true,
array $changeTags = [] ) {
array $changeTags = []
) {
global $wgUser;
$err = $this->isValidMoveOperation( $nt, $auth, $reason );
if ( is_array( $err ) ) {
@ -3773,8 +3773,8 @@ class Title implements LinkTarget {
* no pages were moved
*/
public function moveSubpages( $nt, $auth = true, $reason = '', $createRedirect = true,
array $changeTags = [] ) {
array $changeTags = []
) {
global $wgMaximumMovedPages;
// Check permissions
if ( !$this->userCan( 'move-subpages' ) ) {

View file

@ -44,7 +44,6 @@ class CreditsAction extends FormlessAction {
* @return string HTML
*/
public function onView() {
if ( $this->page->getID() == 0 ) {
$s = $this->msg( 'nocredits' )->parse();
} else {

View file

@ -967,7 +967,6 @@ abstract class ApiBase extends ContextSource {
* @return bool
*/
protected function getWatchlistValue( $watchlist, $titleObj, $userOption = null ) {
$userWatching = $this->getUser()->isWatched( $titleObj, User::IGNORE_USER_RIGHTS );
switch ( $watchlist ) {

View file

@ -64,7 +64,6 @@ class ApiEditPage extends ApiBase {
/** @var $newTitle Title */
foreach ( $titles as $id => $newTitle ) {
if ( !isset( $titles[$id - 1] ) ) {
$titles[$id - 1] = $oldTitle;
}

View file

@ -97,7 +97,6 @@ class ApiModuleManager extends ContextSource {
* @param string $group Which group modules belong to (action,format,...)
*/
public function addModules( array $modules, $group ) {
foreach ( $modules as $name => $moduleSpec ) {
if ( is_array( $moduleSpec ) ) {
$class = $moduleSpec['class'];

View file

@ -356,7 +356,6 @@ abstract class ApiQueryBase extends ApiBase {
* @return ResultWrapper
*/
protected function select( $method, $extraQuery = [], array &$hookData = null ) {
$tables = array_merge(
$this->tables,
isset( $extraQuery['tables'] ) ? (array)$extraQuery['tables'] : []

View file

@ -182,7 +182,6 @@ class ApiQueryUsers extends ApiQueryBase {
}
foreach ( $res as $row ) {
// create user object and pass along $userGroups if set
// that reduces the number of database queries needed in User dramatically
if ( !isset( $userGroups ) ) {

View file

@ -174,7 +174,6 @@ class BacklinkCache {
* @return ResultWrapper
*/
protected function queryLinks( $table, $startId, $endId, $max, $select = 'all' ) {
$fromField = $this->getPrefix( $table ) . '_from';
if ( !$startId && !$endId && is_infinite( $max )

View file

@ -184,8 +184,8 @@ class ChangesListBooleanFilter extends ChangesListFilter {
* @param array &$join_conds Array of join conditions; see IDatabase::select $join_conds
*/
public function modifyQuery( IDatabase $dbr, ChangesListSpecialPage $specialPage,
&$tables, &$fields, &$conds, &$query_options, &$join_conds ) {
&$tables, &$fields, &$conds, &$query_options, &$join_conds
) {
if ( $this->queryCallable === null ) {
return;
}

View file

@ -186,12 +186,8 @@ abstract class ChangesListFilter {
* @param string $backwardKey i18n key for conflict message in reverse
* direction (when in UI context of $other object)
*/
public function conflictsWith( $other, $globalKey, $forwardKey,
$backwardKey ) {
if ( $globalKey === null || $forwardKey === null ||
$backwardKey === null ) {
public function conflictsWith( $other, $globalKey, $forwardKey, $backwardKey ) {
if ( $globalKey === null || $forwardKey === null || $backwardKey === null ) {
throw new MWException( 'All messages must be specified' );
}
@ -220,9 +216,7 @@ abstract class ChangesListFilter {
* @param string $contextDescription i18n key for conflict message in this
* direction (when in UI context of $this object)
*/
public function setUnidirectionalConflict( $other, $globalDescription,
$contextDescription ) {
public function setUnidirectionalConflict( $other, $globalDescription, $contextDescription ) {
if ( $other instanceof ChangesListFilterGroup ) {
$this->conflictingGroups[] = [
'group' => $other->getName(),

View file

@ -229,12 +229,8 @@ abstract class ChangesListFilterGroup {
* @param string $backwardKey i18n key for conflict message in reverse
* direction (when in UI context of $other object)
*/
public function conflictsWith( $other, $globalKey, $forwardKey,
$backwardKey ) {
if ( $globalKey === null || $forwardKey === null ||
$backwardKey === null ) {
public function conflictsWith( $other, $globalKey, $forwardKey, $backwardKey ) {
if ( $globalKey === null || $forwardKey === null || $backwardKey === null ) {
throw new MWException( 'All messages must be specified' );
}
@ -263,9 +259,7 @@ abstract class ChangesListFilterGroup {
* @param string $contextDescription i18n key for conflict message in this
* direction (when in UI context of $this object)
*/
public function setUnidirectionalConflict( $other, $globalDescription,
$contextDescription ) {
public function setUnidirectionalConflict( $other, $globalDescription, $contextDescription ) {
if ( $other instanceof ChangesListFilterGroup ) {
$this->conflictingGroups[] = [
'group' => $other->getName(),

View file

@ -185,8 +185,8 @@ class ChangesListStringOptionsFilterGroup extends ChangesListFilterGroup {
* @param string $value URL parameter value
*/
public function modifyQuery( IDatabase $dbr, ChangesListSpecialPage $specialPage,
&$tables, &$fields, &$conds, &$query_options, &$join_conds, $value ) {
&$tables, &$fields, &$conds, &$query_options, &$join_conds, $value
) {
$allowedFilterNames = [];
foreach ( $this->filters as $filter ) {
$allowedFilterNames[] = $filter->getName();

View file

@ -98,7 +98,6 @@ class EnhancedChangesList extends ChangesList {
* @return string
*/
public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
$date = $this->getLanguage()->userDate(
$rc->mAttribs['rc_timestamp'],
$this->getUser()

View file

@ -32,7 +32,6 @@ class OldChangesList extends ChangesList {
* @return string|bool
*/
public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
$classes = $this->getHTMLClasses( $rc, $watched );
// use mw-line-even/mw-line-odd class only if linenumber is given (feature from T16468)
if ( $linenumber ) {

View file

@ -201,7 +201,6 @@ class ChangeTags {
&$rev_id = null, &$log_id = null, $params = null, RecentChange $rc = null,
User $user = null
) {
$tagsToAdd = array_filter( (array)$tagsToAdd ); // Make sure we're submitting all tags...
$tagsToRemove = array_filter( (array)$tagsToRemove );
@ -275,8 +274,8 @@ class ChangeTags {
// update the tag_summary row
$prevTags = [];
if ( !self::updateTagSummaryRow( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id,
$log_id, $prevTags ) ) {
$log_id, $prevTags )
) {
// nothing to do
return [ [], [], $prevTags ];
}
@ -343,8 +342,8 @@ class ChangeTags {
* @since 1.25
*/
protected static function updateTagSummaryRow( &$tagsToAdd, &$tagsToRemove,
$rc_id, $rev_id, $log_id, &$prevTags = [] ) {
$rc_id, $rev_id, $log_id, &$prevTags = []
) {
$dbw = wfGetDB( DB_MASTER );
$tsConds = array_filter( [
@ -419,9 +418,7 @@ class ChangeTags {
* @return Status
* @since 1.25
*/
public static function canAddTagsAccompanyingChange( array $tags,
User $user = null ) {
public static function canAddTagsAccompanyingChange( array $tags, User $user = null ) {
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'applychangetags' ) ) {
return Status::newFatal( 'tags-apply-no-permission' );
@ -465,7 +462,6 @@ class ChangeTags {
public static function addTagsAccompanyingChangeWithChecks(
array $tags, $rc_id, $rev_id, $log_id, $params, User $user
) {
// are we allowed to do this?
$result = self::canAddTagsAccompanyingChange( $tags, $user );
if ( !$result->isOK() ) {
@ -491,8 +487,8 @@ class ChangeTags {
* @since 1.25
*/
public static function canUpdateTags( array $tagsToAdd, array $tagsToRemove,
User $user = null ) {
User $user = null
) {
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'changetags' ) ) {
return Status::newFatal( 'tags-update-no-permission' );
@ -554,8 +550,8 @@ class ChangeTags {
* @since 1.25
*/
public static function updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
$rc_id, $rev_id, $log_id, $params, $reason, User $user ) {
$rc_id, $rev_id, $log_id, $params, $reason, User $user
) {
if ( is_null( $tagsToAdd ) ) {
$tagsToAdd = [];
}
@ -792,8 +788,8 @@ class ChangeTags {
* @since 1.25
*/
protected static function logTagManagementAction( $action, $tag, $reason,
User $user, $tagCount = null, array $logEntryTags = [] ) {
User $user, $tagCount = null, array $logEntryTags = []
) {
$dbw = wfGetDB( DB_MASTER );
$logEntry = new ManualLogEntry( 'managetags', $action );
@ -869,8 +865,8 @@ class ChangeTags {
* @since 1.25
*/
public static function activateTagWithChecks( $tag, $reason, User $user,
$ignoreWarnings = false, array $logEntryTags = [] ) {
$ignoreWarnings = false, array $logEntryTags = []
) {
// are we allowed to do this?
$result = self::canActivateTag( $tag, $user );
if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
@ -932,8 +928,8 @@ class ChangeTags {
* @since 1.25
*/
public static function deactivateTagWithChecks( $tag, $reason, User $user,
$ignoreWarnings = false, array $logEntryTags = [] ) {
$ignoreWarnings = false, array $logEntryTags = []
) {
// are we allowed to do this?
$result = self::canDeactivateTag( $tag, $user );
if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
@ -1034,8 +1030,8 @@ class ChangeTags {
* @since 1.25
*/
public static function createTagWithChecks( $tag, $reason, User $user,
$ignoreWarnings = false, array $logEntryTags = [] ) {
$ignoreWarnings = false, array $logEntryTags = []
) {
// are we allowed to do this?
$result = self::canCreateTag( $tag, $user );
if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
@ -1165,8 +1161,8 @@ class ChangeTags {
* @since 1.25
*/
public static function deleteTagWithChecks( $tag, $reason, User $user,
$ignoreWarnings = false, array $logEntryTags = [] ) {
$ignoreWarnings = false, array $logEntryTags = []
) {
// are we allowed to do this?
$result = self::canDeleteTag( $tag, $user );
if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {

View file

@ -39,8 +39,8 @@ abstract class ChangeTagsList extends RevisionListBase {
* @throws Exception If you give an unknown $typeName
*/
public static function factory( $typeName, IContextSource $context,
Title $title, array $ids ) {
Title $title, array $ids
) {
switch ( $typeName ) {
case 'revision':
$className = 'ChangeTagsRevisionList';

View file

@ -71,9 +71,7 @@ class ChangeTagsLogList extends ChangeTagsList {
* @param User $user
* @return Status
*/
public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
$reason, $user ) {
public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
// @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $this->reset(); $this->current(); $this->next() ) {
// @codingStandardsIgnoreEnd

View file

@ -81,9 +81,7 @@ class ChangeTagsRevisionList extends ChangeTagsList {
* @param User $user
* @return Status
*/
public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
$reason, $user ) {
public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
// @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $this->reset(); $this->current(); $this->next() ) {
// @codingStandardsIgnoreEnd

View file

@ -488,8 +488,8 @@ abstract class AbstractContent implements Content {
$po = new ParserOutput();
if ( Hooks::run( 'ContentGetParserOutput',
[ $this, $title, $revId, $options, $generateHtml, &$po ] ) ) {
[ $this, $title, $revId, $options, $generateHtml, &$po ] )
) {
// Save and restore the old value, just in case something is reusing
// the ParserOptions object in some weird way.
$oldRedir = $options->getRedirectTarget();

View file

@ -619,8 +619,8 @@ abstract class ContentHandler {
*/
public function createDifferenceEngine( IContextSource $context, $old = 0, $new = 0,
$rcid = 0, // FIXME: Deprecated, no longer used
$refreshCache = false, $unhide = false ) {
$refreshCache = false, $unhide = false
) {
// hook: get difference engine
$differenceEngine = null;
if ( !Hooks::run( 'GetDifferenceEngine',

View file

@ -68,7 +68,6 @@ class WikitextContent extends TextContent {
* @see Content::replaceSection()
*/
public function replaceSection( $sectionId, Content $with, $sectionTitle = '' ) {
$myModelId = $this->getModel();
$sectionModelId = $with->getModel();

View file

@ -194,7 +194,6 @@ class LegacyHandler extends AbstractProcessingHandler {
$text = (string)$record['formatted'];
if ( $this->useUdp() ) {
// Clean it up for the multiplexer
if ( $this->prefix !== '' ) {
$leader = ( $this->prefix === '{channel}' ) ?

View file

@ -79,7 +79,6 @@ class DiffEngine {
* @return DiffOp[]
*/
public function diff( $from_lines, $to_lines ) {
// Diff and store locally
$this->diffInternal( $from_lines, $to_lines );

View file

@ -60,7 +60,6 @@ abstract class DiffFormatter {
* @return string The formatted output.
*/
public function format( $diff ) {
$xi = $yi = 1;
$block = false;
$context = [];

View file

@ -196,7 +196,6 @@ class TableDiffFormatter extends DiffFormatter {
* @param string[] $closing
*/
protected function changed( $orig, $closing ) {
$diff = new WordLevelDiff( $orig, $closing );
$del = $diff->orig();
$add = $diff->closing();

View file

@ -199,7 +199,6 @@ class XmlDumpWriter {
* @access private
*/
function writeRevision( $row ) {
$out = " <revision>\n";
$out .= " " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n";
if ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {
@ -287,7 +286,6 @@ class XmlDumpWriter {
* @access private
*/
function writeLogItem( $row ) {
$out = " <logitem>\n";
$out .= " " . Xml::element( 'id', null, strval( $row->log_id ) ) . "\n";

View file

@ -31,7 +31,6 @@ class PackedOverlayImageGallery extends PackedImageGallery {
* @return string
*/
protected function wrapGalleryText( $galleryText, $thumb ) {
// If we have no text, do not output anything to avoid
// ugly white overlay.
if ( trim( $galleryText ) === '' ) {

View file

@ -394,8 +394,8 @@ class WikiImporter {
* @return bool
*/
public function finishImportPage( $title, $foreignTitle, $revCount,
$sRevCount, $pageInfo ) {
$sRevCount, $pageInfo
) {
// Update article count statistics (T42009)
// The normal counting logic in WikiPage->doEditUpdates() is designed for
// one-revision-at-a-time editing, not bulk imports. In this situation it
@ -691,7 +691,6 @@ class WikiImporter {
* @return bool|mixed
*/
private function processLogItem( $logInfo ) {
$revision = new WikiRevision( $this->config );
if ( isset( $logInfo['id'] ) ) {

View file

@ -751,7 +751,6 @@ END;
}
protected function setDefault( $table, $field, $default ) {
$info = $this->db->fieldInfo( $table, $field );
if ( $info->defaultValue() !== $default ) {
$this->output( "Changing '$table.$field' default value\n" );

View file

@ -60,7 +60,6 @@ class InterwikiLookupAdapter implements InterwikiLookup {
* @return bool Whether it exists
*/
public function isValidInterwiki( $prefix ) {
return array_key_exists( $prefix, $this->getInterwikiMap() );
}

View file

@ -234,7 +234,6 @@ class CryptRand {
* @return string Raw binary random data
*/
public function generate( $bytes, $forceStrong = false ) {
$bytes = floor( $bytes );
static $buffer = '';
if ( is_null( $this->strong ) ) {

View file

@ -469,7 +469,6 @@ class MemcachedClient {
* @return mixed
*/
public function get( $key, &$casToken = null ) {
if ( $this->_debug ) {
$this->_debugprint( "get($key)" );
}

View file

@ -135,7 +135,6 @@ class XMPReader implements LoggerAwareInterface {
* Primary job is to initialize the XMLParser
*/
function __construct( LoggerInterface $logger = null ) {
if ( !function_exists( 'xml_parser_create_ns' ) ) {
// this should already be checked by this point
throw new RuntimeException( 'XMP support requires XML Parser' );
@ -174,7 +173,6 @@ class XMPReader implements LoggerAwareInterface {
* For example in jpeg's with extendedXMP
*/
private function resetXMLParser() {
$this->destroyXMLParser();
$this->xmlParser = xml_parser_create_ns( 'UTF-8', ' ' );
@ -495,7 +493,6 @@ class XMPReader implements LoggerAwareInterface {
* @throws RuntimeException On invalid data
*/
function char( $parser, $data ) {
$data = trim( $data );
if ( trim( $data ) === "" ) {
return;
@ -644,7 +641,6 @@ class XMPReader implements LoggerAwareInterface {
* @throws RuntimeException
*/
private function endElementNested( $elm ) {
/* cur item must be the same as $elm, unless if in MODE_STRUCT
* in which case it could also be rdf:Description */
if ( $this->curItem[0] !== $elm
@ -754,7 +750,6 @@ class XMPReader implements LoggerAwareInterface {
* @param string $elm Namespace and element
*/
private function endElementModeQDesc( $elm ) {
if ( $elm === self::NS_RDF . ' value' ) {
list( $ns, $tag ) = explode( ' ', $this->curItem[0], 2 );
$this->saveValue( $ns, $tag, $this->charContent );
@ -1191,7 +1186,6 @@ class XMPReader implements LoggerAwareInterface {
* @throws RuntimeException
*/
function startElement( $parser, $elm, $attribs ) {
if ( $elm === self::NS_RDF . ' RDF'
|| $elm === 'adobe:ns:meta/ xmpmeta'
|| $elm === 'adobe:ns:meta/ xapmeta'
@ -1332,7 +1326,6 @@ class XMPReader implements LoggerAwareInterface {
* @param string $val Value to save
*/
private function saveValue( $ns, $tag, $val ) {
$info =& $this->items[$ns][$tag];
$finalName = isset( $info['map_name'] )
? $info['map_name'] : $tag;

View file

@ -230,7 +230,6 @@ class BitmapMetadataHandler {
* @return array Metadata array
*/
public static function GIF( $filename ) {
$meta = new self();
$baseArray = GIFMetadataExtractor::getMetadata( $filename );

View file

@ -362,7 +362,6 @@ class Exif {
* if we make up our own types like Exif::DATE.
*/
function collapseData() {
$this->exifGPStoNumber( 'GPSLatitude' );
$this->exifGPStoNumber( 'GPSDestLatitude' );
$this->exifGPStoNumber( 'GPSLongitude' );
@ -446,7 +445,6 @@ class Exif {
*/
private function charCodeString( $prop ) {
if ( isset( $this->mFilteredExifData[$prop] ) ) {
if ( strlen( $this->mFilteredExifData[$prop] ) <= 8 ) {
// invalid. Must be at least 9 bytes long.

View file

@ -476,7 +476,6 @@ class IPTC {
* only code that seems to have wide use. It does detect that code.
*/
static function getCharset( $tag ) {
// According to iim standard, charset is defined by the tag 1:90.
// in which there are iso 2022 escape sequences to specify the character set.
// the iim standard seems to encourage that all necessary escape sequences are

View file

@ -94,7 +94,6 @@ class JpegMetadataExtractor {
$buffer = fread( $fh, 1 );
}
if ( $buffer === "\xFE" ) {
// COM section -- file comment
// First see if valid utf-8,
// if not try to convert it to windows-1252.

View file

@ -157,7 +157,6 @@ abstract class MediaHandler {
*/
function convertMetadataVersion( $metadata, $version = 1 ) {
if ( !is_array( $metadata ) ) {
// unserialize to keep return parameter consistent.
MediaWiki\suppressWarnings();
$ret = unserialize( $metadata );

View file

@ -112,7 +112,6 @@ class PNGHandler extends BitmapHandler {
}
function isMetadataValid( $image, $metadata ) {
if ( $metadata === self::BROKEN_FILE ) {
// Do not repetitivly regenerate metadata on broken file.
return self::METADATA_GOOD;

View file

@ -156,7 +156,6 @@ abstract class TransformationalImageHandler extends ImageHandler {
&& $scalerParams['physicalHeight'] == $scalerParams['srcHeight']
&& !isset( $scalerParams['quality'] )
) {
# normaliseParams (or the user) wants us to return the unscaled image
wfDebug( __METHOD__ . ": returning unscaled image\n" );

View file

@ -214,7 +214,6 @@ class Article implements Page {
* @since 1.21
*/
protected function getContentObject() {
if ( $this->mPage->getId() === 0 ) {
# If this is a MediaWiki:x message, then load the messages
# and return the message value for x.
@ -569,8 +568,8 @@ class Article implements Page {
$outputPage->setRevisionTimestamp( $this->mPage->getTimestamp() );
if ( !Hooks::run( 'ArticleContentViewCustom',
[ $this->fetchContentObject(), $this->getTitle(), $outputPage ] ) ) {
[ $this->fetchContentObject(), $this->getTitle(), $outputPage ] )
) {
# Allow extensions do their own custom view for certain pages
$outputDone = true;
}

View file

@ -1314,7 +1314,6 @@ class WikiPage implements Page, IDBAccessObject {
* @return bool
*/
public function updateIfNewerOn( $dbw, $revision ) {
$row = $dbw->selectRow(
[ 'revision', 'page' ],
[ 'rev_id', 'rev_timestamp', 'page_is_redirect' ],
@ -1386,7 +1385,6 @@ class WikiPage implements Page, IDBAccessObject {
public function replaceSectionContent(
$sectionId, Content $sectionContent, $sectionTitle = '', $edittime = null
) {
$baseRevId = null;
if ( $edittime && $sectionId !== 'new' ) {
$dbr = wfGetDB( DB_REPLICA );
@ -1425,7 +1423,6 @@ class WikiPage implements Page, IDBAccessObject {
public function replaceSectionAtRev( $sectionId, Content $sectionContent,
$sectionTitle = '', $baseRevId = null
) {
if ( strval( $sectionId ) === '' ) {
// Whole-page edit; let the whole text through
$newContent = $sectionContent;

View file

@ -174,7 +174,6 @@ class CoreParserFunctions {
$magicWords = new MagicWordArray( [ 'url_path', 'url_query', 'url_wiki' ] );
}
switch ( $magicWords->matchStartToEnd( $arg ) ) {
// Encode as though it's a wiki page, '_' for ' '.
case 'url_wiki':
$func = 'wfUrlencode';

View file

@ -1075,7 +1075,6 @@ class Parser {
* @return string
*/
public function doTableStuff( $text ) {
$lines = StringUtils::explode( "\n", $text );
$out = '';
$td_history = []; # Is currently a td tag open?
@ -1279,7 +1278,6 @@ class Parser {
* @return string
*/
public function internalParse( $text, $isMain = true, $frame = false ) {
$origText = $text;
// Avoid PHP 7.1 warning from passing $this by reference
@ -1855,7 +1853,6 @@ class Parser {
* @return string
*/
public function replaceExternalLinks( $text ) {
$bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
if ( $bits === false ) {
throw new MWException( "PCRE needs to be compiled with "
@ -3031,7 +3028,6 @@ class Parser {
* @return string The text of the template
*/
public function braceSubstitution( $piece, $frame ) {
// Flags
// $text has been filled
@ -3786,7 +3782,6 @@ class Parser {
* @return array
*/
public function argSubstitution( $piece, $frame ) {
$error = false;
$parts = $piece['parts'];
$nameWithSpaces = $frame->expand( $piece['title'] );
@ -3967,7 +3962,6 @@ class Parser {
* @return string
*/
public function doDoubleUnderscore( $text ) {
# The position of __TOC__ needs to be recorded
$mw = MagicWord::get( 'toc' );
if ( $mw->match( $text ) ) {
@ -4948,7 +4942,6 @@ class Parser {
* @return string HTML
*/
public function renderImageGallery( $text, $params ) {
$mode = false;
if ( isset( $params['mode'] ) ) {
$mode = $params['mode'];

View file

@ -148,7 +148,6 @@ class Preprocessor_DOM extends Preprocessor {
* @return PPNode_DOM
*/
public function preprocessToObj( $text, $flags = 0 ) {
$xml = $this->cacheGetTree( $text, $flags );
if ( $xml === false ) {
$xml = $this->preprocessToXml( $text, $flags );
@ -373,7 +372,6 @@ class Preprocessor_DOM extends Preprocessor {
}
// Handle comments
if ( isset( $matches[2] ) && $matches[2] == '!--' ) {
// To avoid leaving blank lines, when a sequence of
// space-separated comments is both preceded and followed by
// a newline (ignoring spaces), then

View file

@ -304,7 +304,6 @@ class Preprocessor_Hash extends Preprocessor {
}
// Handle comments
if ( isset( $matches[2] ) && $matches[2] == '!--' ) {
// To avoid leaving blank lines, when a sequence of
// space-separated comments is both preceded and followed by
// a newline (ignoring spaces), then

View file

@ -461,7 +461,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
* @param array $localFileRefs List of files
*/
protected function saveFileDependencies( ResourceLoaderContext $context, $localFileRefs ) {
try {
// Related bugs and performance considerations:
// 1. Don't needlessly change the database value with the same list in a
@ -757,7 +756,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
// (e.g. startup module) iterate more than once over all modules to get versions.
$contextHash = $context->getHash();
if ( !array_key_exists( $contextHash, $this->versionHash ) ) {
if ( $this->enableModuleContentVersion() ) {
// Detect changes directly
$str = json_encode( $this->getModuleContent( $context ) );

View file

@ -33,7 +33,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
* @return array
*/
protected function getConfigSettings( $context ) {
$hash = $context->getHash();
if ( isset( $this->configVars[$hash] ) ) {
return $this->configVars[$hash];
@ -135,7 +134,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
// The list of implicit dependencies won't be altered, so we can
// cache them without having to worry.
if ( !isset( $dependencyCache[$moduleName] ) ) {
if ( !isset( $registryData[$moduleName] ) ) {
// Dependencies may not exist
$dependencyCache[$moduleName] = [];

View file

@ -70,7 +70,6 @@ class SearchNearMatcher {
}
foreach ( $allSearchTerms as $term ) {
# Exact match? No need to look further.
$title = Title::newFromText( $term );
if ( is_null( $title ) ) {

View file

@ -69,7 +69,6 @@ class MediaWikiPageNameNormalizer {
* @throws \MWException
*/
public function normalizePageName( $pageName, $apiUrl ) {
// Check if we have strings as arguments.
if ( !is_string( $pageName ) ) {
throw new \MWException( '$pageName must be a string' );

View file

@ -33,7 +33,6 @@ class MediaWikiI18N {
}
function translate( $value ) {
// Hack for i18n:attributes in PHPTAL 1.0.0 dev version as of 2004-10-23
$value = preg_replace( '/^string:/', '', $value );

View file

@ -1391,7 +1391,6 @@ abstract class Skin extends ContextSource {
* @return string
*/
function getNewtalks() {
$newMessagesAlert = '';
$user = $this->getUser();
$newtalks = $user->getNewMessageLinks();

View file

@ -92,8 +92,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'showHideSuffix' => 'showhideliu',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_user = 0';
},
'cssClassSuffix' => 'liu',
@ -111,8 +111,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'showHideSuffix' => 'showhideanons',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_user != 0';
},
'cssClassSuffix' => 'anon',
@ -182,8 +182,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'showHideSuffix' => 'showhidemine',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$user = $ctx->getUser();
$conds[] = 'rc_user_text != ' . $dbr->addQuotes( $user->getName() );
},
@ -198,8 +198,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'description' => 'rcfilters-filter-editsbyother-description',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$user = $ctx->getUser();
$conds[] = 'rc_user_text = ' . $dbr->addQuotes( $user->getName() );
},
@ -225,8 +225,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'showHideSuffix' => 'showhidebots',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_bot = 0';
},
'cssClassSuffix' => 'bot',
@ -240,8 +240,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'description' => 'rcfilters-filter-humans-description',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_bot = 1';
},
'cssClassSuffix' => 'human',
@ -269,8 +269,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'showHideSuffix' => 'showhideminor',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_minor = 0';
},
'cssClassSuffix' => 'minor',
@ -284,8 +284,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'description' => 'rcfilters-filter-major-description',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_minor = 1';
},
'cssClassSuffix' => 'major',
@ -347,8 +347,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'default' => false,
'priority' => -2,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_type != ' . $dbr->addQuotes( RC_EDIT );
},
'cssClassSuffix' => 'src-mw-edit',
@ -363,8 +363,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'default' => false,
'priority' => -3,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_type != ' . $dbr->addQuotes( RC_NEW );
},
'cssClassSuffix' => 'src-mw-new',
@ -382,8 +382,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'default' => false,
'priority' => -5,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_type != ' . $dbr->addQuotes( RC_LOG );
},
'cssClassSuffix' => 'src-mw-log',
@ -412,8 +412,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'showHideSuffix' => 'showhidepatr',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_patrolled = 0';
},
'cssClassSuffix' => 'patrolled',
@ -427,8 +427,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'description' => 'rcfilters-filter-unpatrolled-description',
'default' => false,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_patrolled = 1';
},
'cssClassSuffix' => 'unpatrolled',
@ -450,8 +450,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
'default' => false,
'priority' => -4,
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds ) {
&$query_options, &$join_conds
) {
$conds[] = 'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE );
},
'cssClassSuffix' => 'src-mw-categorize',
@ -470,7 +470,6 @@ abstract class ChangesListSpecialPage extends SpecialPage {
$opts = $this->getOptions();
/** @var ChangesListFilterGroup $group */
foreach ( $this->getFilterGroups() as $group ) {
if ( $group->getConflictingGroups() ) {
wfLogWarning(
$group->getName() .
@ -487,7 +486,6 @@ abstract class ChangesListSpecialPage extends SpecialPage {
/** @var ChangesListFilter $filter */
foreach ( $group->getFilters() as $filter ) {
/** @var ChangesListFilter $conflictingFilter */
foreach ( $filter->getConflictingFilters() as $conflictingFilter ) {
if (
@ -1061,8 +1059,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
* @param FormOptions $opts
*/
protected function buildQuery( &$tables, &$fields, &$conds, &$query_options,
&$join_conds, FormOptions $opts ) {
&$join_conds, FormOptions $opts
) {
$dbr = $this->getDB();
$user = $this->getUser();
@ -1121,8 +1119,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
* @return bool|ResultWrapper Result or false
*/
protected function doMainQuery( $tables, $fields, $conds,
$query_options, $join_conds, FormOptions $opts ) {
$query_options, $join_conds, FormOptions $opts
) {
$tables[] = 'recentchanges';
$fields = array_merge( RecentChange::selectFields(), $fields );
@ -1332,8 +1330,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
* (optional)
*/
public function filterOnUserExperienceLevel( $specialPageClassName, $context, $dbr,
&$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now = 0 ) {
&$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now = 0
) {
global $wgLearnerEdits,
$wgExperiencedUserEdits,
$wgLearnerMemberSince,

View file

@ -601,7 +601,6 @@ abstract class QueryPage extends SpecialPage {
# Get the cached result, select one extra row for navigation
$res = $this->fetchFromCache( $dbLimit, $this->offset );
if ( !$this->listoutput ) {
# Fetch the timestamp of this update
$ts = $this->getCachedTimestamp();
$lang = $this->getLanguage();

View file

@ -234,7 +234,6 @@ class SpecialPageFactory {
global $wgPageLanguageUseDB, $wgContentHandlerUseDB;
if ( !is_array( self::$list ) ) {
self::$list = self::$coreList;
if ( !$wgDisableInternalSearch ) {

View file

@ -63,7 +63,6 @@ class SpecialChangeEmail extends FormSpecialPage {
}
protected function checkExecutePermissions( User $user ) {
if ( !AuthManager::singleton()->allowsPropertyChange( 'emailaddress' ) ) {
throw new ErrorPageError( 'changeemail', 'cannotchangeemail' );
}

View file

@ -329,7 +329,6 @@ class SpecialContributions extends IncludableSpecialPage {
* @return array
*/
public static function getUserLinks( SpecialPage $sp, User $target ) {
$id = $target->getId();
$username = $target->getName();
$userpage = $target->getUserPage();

View file

@ -330,7 +330,6 @@ class SpecialExport extends SpecialPage {
* @param bool $exportall Whether to export everything
*/
private function doExport( $page, $history, $list_authors, $exportall ) {
// If we are grabbing everything, enable full history and ignore the rest
if ( $exportall ) {
$history = WikiExporter::FULL;

View file

@ -48,7 +48,6 @@ class SpecialPageData extends SpecialPage {
* @return PageDataRequestHandler
*/
private function newDefaultRequestHandler() {
return new PageDataRequestHandler();
}

View file

@ -367,8 +367,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
* @inheritdoc
*/
protected function buildQuery( &$tables, &$fields, &$conds,
&$query_options, &$join_conds, FormOptions $opts ) {
&$query_options, &$join_conds, FormOptions $opts
) {
$dbr = $this->getDB();
parent::buildQuery( $tables, $fields, $conds,
$query_options, $join_conds, $opts );
@ -392,8 +392,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
* @inheritdoc
*/
protected function doMainQuery( $tables, $fields, $conds, $query_options,
$join_conds, FormOptions $opts ) {
$join_conds, FormOptions $opts
) {
$dbr = $this->getDB();
$user = $this->getUser();

View file

@ -50,8 +50,8 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
* @inheritdoc
*/
protected function doMainQuery( $tables, $select, $conds, $query_options,
$join_conds, FormOptions $opts ) {
$join_conds, FormOptions $opts
) {
$target = $opts['target'];
$showlinkedto = $opts['showlinkedto'];
$limit = $opts['limit'];

View file

@ -399,7 +399,6 @@ class SpecialSearch extends SpecialPage {
$mainResultWidget = new FullSearchResultWidget( $this, $linkRenderer );
if ( $search->getFeatureData( 'enable-new-crossproject-page' ) ) {
$sidebarResultWidget = new InterwikiSearchResultWidget( $this, $linkRenderer );
$sidebarResultsWidget = new InterwikiSearchResultSetWidget(
$this,

View file

@ -96,7 +96,6 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
$includesCachedPages = false;
foreach ( $groups as $group => $sortedPages ) {
$out->wrapWikiMsg(
"<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n",
"specialpages-group-$group"

View file

@ -253,7 +253,6 @@ class SpecialStatistics extends SpecialPage {
foreach ( $stats as $header => $items ) {
// Identify the structure used
if ( is_array( $items ) ) {
// Ignore headers that are recursively set as legacy header
if ( $header !== 'statistics-header-hooks' ) {
$return .= $this->formatRowHeader( $header );

View file

@ -246,7 +246,6 @@ class SpecialTags extends SpecialPage {
}
if ( $showManageActions ) { // we've already checked that the user had the requisite userright
// activate
if ( ChangeTags::canActivateTag( $tag )->isOK() ) {
$actionLinks[] = $linkRenderer->makeKnownLink(
@ -264,7 +263,6 @@ class SpecialTags extends SpecialPage {
[],
[ 'tag' => $tag ] );
}
}
if ( $showDeleteActions || $showManageActions ) {

View file

@ -678,7 +678,6 @@ class SpecialUpload extends SpecialPage {
*/
protected function processVerificationError( $details ) {
switch ( $details['status'] ) {
/** Statuses that only require name changing **/
case UploadBase::MIN_LENGTH_PARTNAME:
$this->showRecoverableUploadError( $this->msg( 'minlength1' )->escaped() );

View file

@ -326,8 +326,8 @@ class UserrightsPage extends SpecialPage {
* @return array Tuple of added, then removed groups
*/
function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [],
$groupExpiries = [] ) {
$groupExpiries = []
) {
// Validate input set...
$isself = $user->getName() == $this->getUser()->getName();
$groups = $user->getGroups();
@ -433,8 +433,8 @@ class UserrightsPage extends SpecialPage {
* @param array $newUGMs Associative array of (group name => UserGroupMembership)
*/
protected function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags,
$oldUGMs, $newUGMs ) {
$oldUGMs, $newUGMs
) {
// make sure $oldUGMs and $newUGMs are in the same order, and serialise
// each UGM object to a simplified array
$oldUGMs = array_map( function ( $group ) use ( $oldUGMs ) {

View file

@ -246,8 +246,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
* @inheritdoc
*/
protected function buildQuery( &$tables, &$fields, &$conds, &$query_options,
&$join_conds, FormOptions $opts ) {
&$join_conds, FormOptions $opts
) {
$dbr = $this->getDB();
parent::buildQuery( $tables, $fields, $conds, $query_options, $join_conds,
$opts );
@ -263,8 +263,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
* @inheritdoc
*/
protected function doMainQuery( $tables, $fields, $conds, $query_options,
$join_conds, FormOptions $opts ) {
$join_conds, FormOptions $opts
) {
$dbr = $this->getDB();
$user = $this->getUser();

View file

@ -86,7 +86,6 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
if ( $this->language->needsGenderDistinction() &&
MWNamespace::hasGenderDistinction( $namespace )
) {
// NOTE: we are assuming here that the title text is a user name!
$gender = $this->genderCache->getGenderOf( $text, __METHOD__ );
$name = $this->language->getGenderNsText( $namespace, $gender );

View file

@ -321,7 +321,6 @@ abstract class UploadBase {
* @return mixed Const self::OK or else an array with error information
*/
public function verifyUpload() {
/**
* If there was no filename or a zero size given, give up quick.
*/
@ -1431,7 +1430,6 @@ abstract class UploadBase {
* @return bool
*/
public function checkSvgScriptCallback( $element, $attribs, $data = null ) {
list( $namespace, $strippedElement ) = $this->splitXmlNamespace( $element );
// We specifically don't include:
@ -1666,7 +1664,6 @@ abstract class UploadBase {
* @return bool true if the CSS contains an illegal string, false if otherwise
*/
private static function checkCssFragment( $value ) {
# Forbid external stylesheets, for both reliability and to protect viewer's privacy
if ( stripos( $value, '@import' ) !== false ) {
return true;

View file

@ -344,8 +344,8 @@ class UserGroupMembership {
* @return string
*/
public static function getLink( $ugm, IContextSource $context, $format,
$userName = null ) {
$userName = null
) {
if ( $format !== 'wiki' && $format !== 'html' ) {
throw new MWException( 'UserGroupMembership::getLink() $format parameter should be ' .
"'wiki' or 'html'" );

View file

@ -137,13 +137,11 @@ class AutoloadGenerator {
// format class-name : path when they get converted into json.
foreach ( $this->classes as $path => $contained ) {
foreach ( $contained as $fqcn ) {
// Using substr to remove the leading '/'
$json[$key][$fqcn] = substr( $path, 1 );
}
}
foreach ( $this->overrides as $path => $fqcn ) {
// Using substr to remove the leading '/'
$json[$key][$fqcn] = substr( $path, 1 );
}
@ -223,7 +221,6 @@ EOD;
* @return string
*/
public function getAutoload( $commandName = 'AutoloadGenerator' ) {
// We need to check whether an extenson.json or skin.json exists or not, and
// incase it doesn't, update the autoload.php file.

View file

@ -123,7 +123,6 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
* @return string HTML
*/
protected function footerHtml( $term, $iwPrefix ) {
$href = Title::makeTitle( NS_SPECIAL, 'Search', null, $iwPrefix )->getLocalURL(
[ 'search' => $term, 'fulltext' => 1 ]
);
@ -171,7 +170,6 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
* @return OOUI\IconWidget
**/
protected function iwIcon( $iwPrefix ) {
$interwiki = $this->iwLookup->fetch( $iwPrefix );
$parsed = wfParseUrl( wfExpandUrl( $interwiki ? $interwiki->getURL() : '/' ) );

View file

@ -29,7 +29,6 @@ class InterwikiSearchResultWidget implements SearchResultWidget {
* @return string HTML
*/
public function render( SearchResult $result, $terms, $position ) {
$title = $result->getTitle();
$iwPrefix = $result->getTitle()->getInterwiki();
$titleSnippet = $result->getTitleSnippet();
@ -46,7 +45,6 @@ class InterwikiSearchResultWidget implements SearchResultWidget {
$redirectTitle = $result->getRedirectTitle();
$redirect = '';
if ( $redirectTitle !== null ) {
$redirectText = $result->getRedirectSnippet();
if ( $redirectText ) {

View file

@ -361,7 +361,6 @@ class Language {
* @return bool
*/
public static function isValidBuiltInCode( $code ) {
if ( !is_string( $code ) ) {
if ( is_object( $code ) ) {
$addmsg = " of class " . get_class( $code );

View file

@ -339,7 +339,6 @@ class LanguageConverter {
* @return string The converted text
*/
public function autoConvert( $text, $toVariant = false ) {
$this->loadTables();
if ( !$toVariant ) {

View file

@ -44,7 +44,6 @@ class LanguageBe_tarask extends Language {
* @return string
*/
function normalizeForSearch( $string ) {
# MySQL fulltext index doesn't grok utf-8, so we
# need to fold cases and convert to hex

View file

@ -86,7 +86,6 @@ class KkConverter extends LanguageConverter {
}
function loadRegs() {
$this->mCyrl2Latn = [
# # Punctuation
'/№/u' => 'No.',
@ -423,7 +422,6 @@ class LanguageKk extends LanguageKk_cyrl {
* @return string
*/
function convertGrammar( $word, $case ) {
$variant = $this->getPreferredVariant();
switch ( $variant ) {
case 'kk-arab':

View file

@ -37,7 +37,6 @@ class LanguageKu_ku extends Language {
* @return string
*/
function commafy( $_ ) {
if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
} else {

View file

@ -54,7 +54,6 @@ class LanguageYue extends Language {
* @return string
*/
function normalizeForSearch( $string ) {
// Double-width roman characters
$s = self::convertDoubleWidth( $string );
$s = trim( $s );

View file

@ -56,7 +56,6 @@ class LanguageZh_hans extends Language {
* @return string
*/
function normalizeForSearch( $s ) {
// Double-width roman characters
$s = parent::normalizeForSearch( $s );
$s = trim( $s );

View file

@ -168,7 +168,6 @@ class CheckSyntax extends Maintenance {
* @return array Resulting list of changed files
*/
private function getGitModifiedFiles( $path ) {
global $wgMaxShellMemory;
if ( !is_dir( "$path/.git" ) ) {

View file

@ -43,7 +43,6 @@ class DeleteOldRevisions extends Maintenance {
}
function doDelete( $delete = false, $args = [] ) {
# Data should come off the master, wrapped in a transaction
$dbw = $this->getDB( DB_MASTER );
$this->beginTransaction( $dbw, __METHOD__ );

View file

@ -575,7 +575,6 @@ TEXT
}
while ( $failures < $this->maxFailures ) {
// As soon as we found a good text for the $id, we will return immediately.
// Hence, if we make it past the try catch block, we know that we did not
// find a good text.

View file

@ -185,9 +185,7 @@ class ImportImages extends Maintenance {
# Batch "upload" operation
$count = count( $files );
if ( $count > 0 ) {
foreach ( $files as $file ) {
if ( $sleep && ( $processed > 0 ) ) {
sleep( $sleep );
}

View file

@ -93,7 +93,6 @@ if ( $run ) {
$count = 0;
if ( ( $messageExist ) && ( $messageCExist ) ) {
if ( !strcmp( $runMode, 'php' ) ) {
print "<?php\n";
print '$dupeMessages = [' . "\n";

View file

@ -256,7 +256,6 @@ class NamespaceConflictChecker extends Maintenance {
$ok = true;
foreach ( $targets as $row ) {
// Find the new title and determine the action to take
$newTitle = $this->getDestinationTitle( $ns, $name,

View file

@ -39,7 +39,6 @@ class NukePage extends Maintenance {
}
public function execute() {
$name = $this->getArg();
$delete = $this->getOption( 'delete', false );

Some files were not shown because too many files have changed in this diff Show more