Miscellaneous indentation tweaks
authorBartosz Dziewoński <matma.rex@gmail.com>
Sat, 25 Feb 2017 21:53:36 +0000 (22:53 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 27 Feb 2017 18:23:54 +0000 (19:23 +0100)
I was bored. What? Don't look at me that way.

I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.

Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0

76 files changed:
docs/uidesign/child-selector-emu.html
includes/Block.php
includes/DefaultSettings.php
includes/EditPage.php
includes/GlobalFunctions.php
includes/MagicWord.php
includes/PHPVersionCheck.php
includes/Sanitizer.php
includes/Title.php
includes/api/ApiLogin.php
includes/api/ApiQueryRecentChanges.php
includes/content/ContentHandler.php
includes/content/FileContentHandler.php
includes/content/TextContentHandler.php
includes/content/WikiTextStructure.php
includes/content/WikitextContentHandler.php
includes/debug/MWDebug.php
includes/debug/logger/monolog/KafkaHandler.php
includes/diff/WordAccumulator.php
includes/exception/UserNotLoggedIn.php
includes/export/WikiExporter.php
includes/htmlform/HTMLForm.php
includes/http/Http.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteInstaller.php
includes/installer/WebInstallerOutput.php
includes/jobqueue/JobQueueRedis.php
includes/jobqueue/jobs/RefreshLinksJob.php
includes/jobqueue/utils/BacklinkJobUtils.php
includes/libs/CSSMin.php
includes/libs/CryptHKDF.php
includes/libs/StatusValue.php
includes/libs/mime/mime.info
includes/libs/objectcache/RESTBagOStuff.php
includes/libs/objectcache/WinCacheBagOStuff.php
includes/libs/xmp/XMP.php
includes/mail/UserMailer.php
includes/media/DjVuImage.php
includes/media/Jpeg.php
includes/parser/DateFormatter.php
includes/parser/Parser.php
includes/registration/Processor.php
includes/registration/VersionChecker.php
includes/search/SearchIndexFieldDefinition.php
includes/session/SessionManagerInterface.php
includes/session/SessionProvider.php
includes/skins/BaseTemplate.php
includes/specialpage/LoginSignupSpecialPage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialStatistics.php
includes/tidy/Balancer.php
includes/user/User.php
includes/utils/BatchRowIterator.php
includes/utils/MWCryptHKDF.php
languages/Language.php
languages/LanguageConverter.php
languages/classes/LanguageKsh.php
languages/classes/LanguageLa.php
languages/messages/MessagesEn.php
maintenance/hhvm/makeRepo.php
maintenance/importImages.php
maintenance/userDupes.inc
resources/src/mediawiki.action/mediawiki.action.view.redirectPage.css
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
resources/src/mediawiki.skinning/content.parsoid.less
resources/src/mediawiki/mediawiki.storage.js
resources/src/mediawiki/page/gallery-slideshow.js
tests/phpunit/autoload.ide.php
tests/phpunit/includes/MWNamespaceTest.php
tests/phpunit/includes/MessageTest.php
tests/phpunit/includes/content/ContentHandlerTest.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/phpunit/includes/objectcache/RESTBagOStuffTest.php
tests/phpunit/includes/search/SearchIndexFieldTest.php
tests/phpunit/includes/utils/UIDGeneratorTest.php
tests/phpunit/suite.xml

index dedb3a6..9db4c54 100644 (file)
@@ -26,7 +26,7 @@
 
                /** second table. Try to emulate child selector */
                table.childemu th,
-               table.childemu td {
+               table.childemu td {
                        border: 1px red solid;
                        background-color:white;
                        padding:1em;
index 66b9ff0..2b6d8ee 100644 (file)
@@ -1142,7 +1142,7 @@ class Block {
         * Get all blocks that match any IP from an array of IP addresses
         *
         * @param array $ipChain List of IPs (strings), usually retrieved from the
-        *         X-Forwarded-For header of the request
+        *     X-Forwarded-For header of the request
         * @param bool $isAnon Exclude anonymous-only blocks if false
         * @param bool $fromMaster Whether to query the master or replica DB
         * @return array Array of Blocks
@@ -1223,9 +1223,9 @@ class Block {
         *
         * @param array $blocks Array of Block objects
         * @param array $ipChain List of IPs (strings). This is used to determine how "close"
-        *        a block is to the server, and if a block matches exactly, or is in a range.
-        *        The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2,
-        *        local-squid, ...)
+        *     a block is to the server, and if a block matches exactly, or is in a range.
+        *     The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2,
+        *     local-squid, ...)
         * @throws MWException
         * @return Block|null The "best" block from the list
         */
index c64f550..49e726a 100644 (file)
@@ -1442,14 +1442,19 @@ $wgUseTinyRGBForJPGThumbnails = false;
  * Default parameters for the "<gallery>" tag
  */
 $wgGalleryOptions = [
-       'imagesPerRow' => 0, // Default number of images per-row in the gallery. 0 -> Adapt to screensize
-       'imageWidth' => 120, // Width of the cells containing images in galleries (in "px")
-       'imageHeight' => 120, // Height of the cells containing images in galleries (in "px")
-       'captionLength' => true, // Deprecated @since 1.28
-                                // Length to truncate filename to in caption when using "showfilename".
-                                // A value of 'true' will truncate the filename to one line using CSS
-                                // and will be the behaviour after deprecation.
-       'showBytes' => true, // Show the filesize in bytes in categories
+       // Default number of images per-row in the gallery. 0 -> Adapt to screensize
+       'imagesPerRow' => 0,
+       // Width of the cells containing images in galleries (in "px")
+       'imageWidth' => 120,
+       // Height of the cells containing images in galleries (in "px")
+       'imageHeight' => 120,
+       // Length to truncate filename to in caption when using "showfilename".
+       // A value of 'true' will truncate the filename to one line using CSS
+       // and will be the behaviour after deprecation.
+       // @deprecated since 1.28
+       'captionLength' => true,
+       // Show the filesize in bytes in categories
+       'showBytes' => true,
        'mode' => 'traditional',
 ];
 
@@ -4565,8 +4570,8 @@ $wgAuthManagerAutoConfig = [
                ],
                // Linking during login is experimental, enable at your own risk - T134952
                // MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
-               //      'class' => MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
-               //      'sort' => 100,
+               //   'class' => MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
+               //   'sort' => 100,
                // ],
                MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class => [
                        'class' => MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class,
index 814da6a..97a5592 100644 (file)
@@ -2618,7 +2618,7 @@ class EditPage {
                        return;
                }
 
-               $this->showHeader();
+               $this->showHeader();
 
                $wgOut->addHTML( $this->editFormPageTop );
 
index af5d5fa..3747c23 100644 (file)
@@ -222,18 +222,18 @@ function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) {
 /**
  * Merge arrays in the style of getUserPermissionsErrors, with duplicate removal
  * e.g.
- *     wfMergeErrorArrays(
- *             [ [ 'x' ] ],
- *             [ [ 'x', '2' ] ],
- *             [ [ 'x' ] ],
- *             [ [ 'y' ] ]
- *     );
+ *     wfMergeErrorArrays(
+ *       [ [ 'x' ] ],
+ *       [ [ 'x', '2' ] ],
+ *       [ [ 'x' ] ],
+ *       [ [ 'y' ] ]
+ *     );
  * returns:
- *             [
- *             [ 'x', '2' ],
- *             [ 'x' ],
- *             [ 'y' ]
- *     ]
+ *     [
+ *       [ 'x', '2' ],
+ *       [ 'x' ],
+ *       [ 'y' ]
+ *     ]
  *
  * @param array $array1,...
  * @return array
@@ -2573,8 +2573,8 @@ function wfInitShellLocale() {
  * @param string $script MediaWiki cli script path
  * @param array $parameters Arguments and options to the script
  * @param array $options Associative array of options:
- *             'php': The path to the php executable
- *             'wrapper': Path to a PHP wrapper to handle the maintenance script
+ *     'php': The path to the php executable
+ *     'wrapper': Path to a PHP wrapper to handle the maintenance script
  * @return string
  */
 function wfShellWikiCmd( $script, array $parameters = [], array $options = [] ) {
index 09317d7..e234a4c 100644 (file)
@@ -46,8 +46,8 @@
  * $magicWords = [];
  *
  * $magicWords['en'] = [
- *     'magicwordkey' => [ 0, 'case_insensitive_magic_word' ],
- *     'magicwordkey2' => [ 1, 'CASE_sensitive_magic_word2' ],
+ *   'magicwordkey' => [ 0, 'case_insensitive_magic_word' ],
+ *   'magicwordkey2' => [ 1, 'CASE_sensitive_magic_word2' ],
  * ];
  * @endcode
  *
index e6e96c7..c56931e 100644 (file)
@@ -75,16 +75,17 @@ class PHPVersionCheck {
         * @return $this
         */
        function checkRequiredPHPVersion() {
-               if ( !function_exists( 'version_compare' )
-                    || version_compare( $this->getPHPImplVersion(), $this->minimumVersionPHP ) < 0
+               if (
+                       !function_exists( 'version_compare' )
+                       || version_compare( $this->getPHPImplVersion(), $this->minimumVersionPHP ) < 0
                ) {
                        $shortText = "MediaWiki $this->mwVersion requires at least PHP version"
-                                    . " $this->minimumVersionPHP, you are using PHP {$this->getPHPImplVersion()}.";
+                               . " $this->minimumVersionPHP, you are using PHP {$this->getPHPImplVersion()}.";
 
                        $longText = "Error: You might be using on older PHP version. \n"
-                                   . "MediaWiki $this->mwVersion needs PHP $this->minimumVersionPHP or higher.\n\n"
-                                   . "Check if you have a newer php executable with a different name, "
-                                   . "such as php5.\n\n";
+                               . "MediaWiki $this->mwVersion needs PHP $this->minimumVersionPHP or higher.\n\n"
+                               . "Check if you have a newer php executable with a different name, "
+                               . "such as php5.\n\n";
 
                        $longHtml = <<<HTML
                        Please consider <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
@@ -112,10 +113,10 @@ HTML;
                        $shortText = "Installing some external dependencies (e.g. via composer) is required.";
 
                        $longText = "Error: You are missing some external dependencies. \n"
-                                   . "MediaWiki now also has some external dependencies that need to be installed\n"
-                                   . "via composer or from a separate git repo. Please see\n"
-                                   . "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
-                                   . "for help on installing the required components.";
+                               . "MediaWiki now also has some external dependencies that need to be installed\n"
+                               . "via composer or from a separate git repo. Please see\n"
+                               . "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
+                               . "for help on installing the required components.";
 
                        $longHtml = <<<HTML
                MediaWiki now also has some external dependencies that need to be installed via
@@ -150,12 +151,12 @@ HTML;
                        foreach ( $missingExtensions as $ext ) {
                                $missingExtText .= " * $ext <$baseUrl/$ext>\n";
                                $missingExtHtml .= "<li><b>$ext</b> "
-                                                  . "(<a href=\"$baseUrl/$ext\">more information</a>)</li>";
+                                       . "(<a href=\"$baseUrl/$ext\">more information</a>)</li>";
                        }
 
                        $cliText = "Error: Missing one or more required components of PHP.\n"
-                                  . "You are missing a required extension to PHP that MediaWiki needs.\n"
-                                  . "Please install:\n" . $missingExtText;
+                               . "You are missing a required extension to PHP that MediaWiki needs.\n"
+                               . "Please install:\n" . $missingExtText;
 
                        $longHtml = <<<HTML
                You are missing a required extension to PHP that MediaWiki
@@ -198,7 +199,7 @@ HTML;
                }
                $encLogo =
                        htmlspecialchars( str_replace( '//', '/', $dirname . '/' ) .
-                                         'resources/assets/mediawiki.png' );
+                               'resources/assets/mediawiki.png' );
                $shortHtml = htmlspecialchars( $shortText );
 
                header( 'Content-type: text/html; charset=UTF-8' );
index 42b166d..2845d17 100644 (file)
@@ -344,12 +344,12 @@ class Sanitizer {
                        $space = '[\x09\x0a\x0c\x0d\x20]';
                        self::$attribsRegex =
                                "/(?:^|$space)({$attribFirst}{$attrib}*)
-                                 ($space*=$space*
+                                       ($space*=$space*
                                        (?:
-                                        # The attribute value: quoted or alone
-                                         \"([^\"]*)(?:\"|\$)
-                                        | '([^']*)(?:'|\$)
-                                         (((?!$space|>).)*)
+                                               # The attribute value: quoted or alone
+                                               \"([^\"]*)(?:\"|\$)
+                                               | '([^']*)(?:'|\$)
+                                               | (((?!$space|>).)*)
                                        )
                                )?(?=$space|\$)/sx";
                }
index 3ce775b..8f45d5f 100644 (file)
@@ -3865,7 +3865,7 @@ class Title implements LinkTarget {
         * categories' names.
         *
         * @return array Array of parents in the form:
-        *        $parent => $currentarticle
+        *     $parent => $currentarticle
         */
        public function getParentCategories() {
                global $wgContLang;
index e017eda..d64aeb7 100644 (file)
@@ -202,7 +202,7 @@ class ApiLogin extends ApiBase {
 
                        case 'Aborted':
                                $result['reason'] = 'Authentication requires user interaction, ' .
-                                  'which is not supported by action=login.';
+                                       'which is not supported by action=login.';
                                if ( $this->getConfig()->get( 'EnableBotPasswords' ) ) {
                                        $result['reason'] .= ' To be able to login with action=login, see [[Special:BotPasswords]].';
                                        $result['reason'] .= ' To continue using main-account login, see action=clientlogin.';
index 2c76e97..23780c3 100644 (file)
@@ -147,7 +147,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
 
                /* Build our basic query. Namely, something along the lines of:
                 * SELECT * FROM recentchanges WHERE rc_timestamp > $start
-                *              AND rc_timestamp < $end AND rc_namespace = $namespace
+                *   AND rc_timestamp < $end AND rc_namespace = $namespace
                 */
                $this->addTables( 'recentchanges' );
                $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
index 58665bb..a59c14e 100644 (file)
@@ -1157,8 +1157,11 @@ abstract class ContentHandler {
         * @return array Map of name=>value for fields
         * @since 1.28
         */
-       public function getDataForSearchIndex( WikiPage $page, ParserOutput $output,
-                                              SearchEngine $engine ) {
+       public function getDataForSearchIndex(
+               WikiPage $page,
+               ParserOutput $output,
+               SearchEngine $engine
+       ) {
                $fieldData = [];
                $content = $page->getContent();
 
index 26f1190..843d540 100644 (file)
@@ -30,8 +30,11 @@ class FileContentHandler extends WikitextContentHandler  {
                return $fields;
        }
 
-       public function getDataForSearchIndex( WikiPage $page, ParserOutput $parserOutput,
-                                              SearchEngine $engine ) {
+       public function getDataForSearchIndex(
+               WikiPage $page,
+               ParserOutput $parserOutput,
+               SearchEngine $engine
+       ) {
                $fields = [];
 
                $title = $page->getTitle();
index 09cdcee..1f0aacf 100644 (file)
@@ -150,8 +150,11 @@ class TextContentHandler extends ContentHandler {
                return $fields;
        }
 
-       public function getDataForSearchIndex( WikiPage $page, ParserOutput $output,
-                                              SearchEngine $engine ) {
+       public function getDataForSearchIndex(
+               WikiPage $page,
+               ParserOutput $output,
+               SearchEngine $engine
+       ) {
                $fields = parent::getDataForSearchIndex( $page, $output, $engine );
                $fields['language'] =
                        $this->getPageLanguage( $page->getTitle(), $page->getContent() )->getCode();
index f4a6dc6..9f79aa8 100644 (file)
@@ -27,26 +27,32 @@ class WikiTextStructure {
         * @var string[] selectors to elements that are excluded entirely from search
         */
        private $excludedElementSelectors = [
-               'audio', 'video',       // "it looks like you don't have javascript enabled..."
-                                       // do not need to index
-               'sup.reference',        // The [1] for references
-               '.mw-cite-backlink',    // The ↑ next to references in the references section
-               'h1', 'h2', 'h3',       // Headings are already indexed in their own field.
-               'h5', 'h6', 'h4',
-               '.autocollapse',        // Collapsed fields are hidden by default so we don't want them
-                                                               // showing up.
+               // "it looks like you don't have javascript enabled..." – do not need to index
+               'audio', 'video',
+               // The [1] for references
+               'sup.reference',
+               // The ↑ next to references in the references section
+               '.mw-cite-backlink',
+               // Headings are already indexed in their own field.
+               'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
+               // Collapsed fields are hidden by default so we don't want them showing up.
+               '.autocollapse',
        ];
 
        /**
         * @var string[] selectors to elements that are considered auxiliary to article text for search
         */
        private $auxiliaryElementSelectors = [
-               '.thumbcaption',        // Thumbnail captions aren't really part of the text proper
-               'table',                // Neither are tables
-               '.rellink',             // Common style for "See also:".
-               '.dablink',             // Common style for calling out helpful links at the top
-                                                               // of the article.
-               '.searchaux',           // New class users can use to mark stuff as auxiliary to searches.
+               // Thumbnail captions aren't really part of the text proper
+               '.thumbcaption',
+               // Neither are tables
+               'table',
+               // Common style for "See also:".
+               '.rellink',
+               // Common style for calling out helpful links at the top of the article.
+               '.dablink',
+               // New class users can use to mark stuff as auxiliary to searches.
+               '.searchaux',
        ];
 
        /**
index 74b2f1a..9c26ae1 100644 (file)
@@ -128,16 +128,20 @@ class WikitextContentHandler extends TextContentHandler {
 
                $fields['opening_text'] =
                        $engine->makeSearchFieldMapping( 'opening_text', SearchIndexField::INDEX_TYPE_TEXT );
-               $fields['opening_text']->setFlag( SearchIndexField::FLAG_SCORING |
-                                                 SearchIndexField::FLAG_NO_HIGHLIGHT );
+               $fields['opening_text']->setFlag(
+                       SearchIndexField::FLAG_SCORING | SearchIndexField::FLAG_NO_HIGHLIGHT
+               );
                // Until we have full first-class content handler for files, we invoke it explicitly here
                $fields = array_merge( $fields, $this->getFileHandler()->getFieldsForSearchIndex( $engine ) );
 
                return $fields;
        }
 
-       public function getDataForSearchIndex( WikiPage $page, ParserOutput $parserOutput,
-                                              SearchEngine $engine ) {
+       public function getDataForSearchIndex(
+               WikiPage $page,
+               ParserOutput $parserOutput,
+               SearchEngine $engine
+       ) {
                $fields = parent::getDataForSearchIndex( $page, $parserOutput, $engine );
 
                $structure = new WikiTextStructure( $parserOutput );
index 87656f2..e67a0b3 100644 (file)
@@ -370,7 +370,7 @@ class MWDebug {
                                | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start
                                | (?<=[\x0-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle
                                | (?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]
-                                  |[\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence
+                                       | [\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence
                                | (?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF]) # Short 3 byte sequence
                                | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence
                                | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2)
index 432a9e1..6670fe9 100644 (file)
@@ -33,12 +33,12 @@ use Psr\Log\LoggerInterface;
  *
  * Constructor options array arguments:
  * * alias: map from monolog channel to kafka topic name. When no
- *       alias exists the topic "monolog_$channel" will be used.
+ *   alias exists the topic "monolog_$channel" will be used.
  * * swallowExceptions: Swallow exceptions that occur while talking to
- *    kafka. Defaults to false.
+ *   kafka. Defaults to false.
  * * logExceptions: Log exceptions talking to kafka here. Either null,
- *    the name of a channel to log to, or an object implementing
- *    FormatterInterface. Defaults to null.
+ *   the name of a channel to log to, or an object implementing
+ *   FormatterInterface. Defaults to null.
  *
  * Requires the nmred/kafka-php library, version >= 1.3.0
  *
index a26775f..ad80275 100644 (file)
@@ -46,11 +46,9 @@ class WordAccumulator {
        private function flushGroup( $new_tag ) {
                if ( $this->group !== '' ) {
                        if ( $this->tag == 'ins' ) {
-                               $this->line .= "<ins{$this->insClass}>" .
-                                                          htmlspecialchars( $this->group ) . '</ins>';
+                               $this->line .= "<ins{$this->insClass}>" . htmlspecialchars( $this->group ) . '</ins>';
                        } elseif ( $this->tag == 'del' ) {
-                               $this->line .= "<del{$this->delClass}>" .
-                                                          htmlspecialchars( $this->group ) . '</del>';
+                               $this->line .= "<del{$this->delClass}>" . htmlspecialchars( $this->group ) . '</del>';
                        } else {
                                $this->line .= htmlspecialchars( $this->group );
                        }
index 43c5b09..998a930 100644 (file)
@@ -32,7 +32,7 @@
  * @par Example:
  * @code
  * if( $user->isAnon() ) {
- *     throw new UserNotLoggedIn();
+ *   throw new UserNotLoggedIn();
  * }
  * @endcode
  *
@@ -42,7 +42,7 @@
  * @par Example:
  * @code
  * if( $user->isAnon() ) {
- *     throw new UserNotLoggedIn( 'action-require-loggedin' );
+ *   throw new UserNotLoggedIn( 'action-require-loggedin' );
  * }
  * @endcode
  *
index c1f2d59..3949764 100644 (file)
@@ -343,7 +343,7 @@ class WikiExporter {
                                # query optimization for history stub dumps
                                if ( $this->text == WikiExporter::STUB && $orderRevs ) {
                                        $tables = [ 'revision', 'page' ];
-                                       $opts[] = 'STRAIGHT_JOIN';
+                                       $opts[] = 'STRAIGHT_JOIN';
                                        $opts['ORDER BY'] = [ 'rev_page ASC', 'rev_id ASC' ];
                                        $opts['USE INDEX']['revision'] = 'rev_page_id';
                                        $join['page'] = [ 'INNER JOIN', 'rev_page=page_id' ];
index 179f6af..399147b 100644 (file)
@@ -1259,7 +1259,7 @@ class HTMLForm extends ContextSource {
         *
         * @param string|array|Status $elements The set of errors/warnings to process.
         * @param string $elementsType Should warnings or errors be returned.  This is meant
-        *      for Status objects, all other valid types are always considered as errors.
+        *     for Status objects, all other valid types are always considered as errors.
         * @return string
         */
        public function getErrorsOrWarnings( $elements, $elementsType ) {
index 779d606..fa2d5a3 100644 (file)
@@ -46,8 +46,8 @@ class Http {
         *    - caInfo              Provide CA information
         *    - maxRedirects        Maximum number of redirects to follow (defaults to 5)
         *    - followRedirects     Whether to follow redirects (defaults to false).
-        *                                  Note: this should only be used when the target URL is trusted,
-        *                                  to avoid attacks on intranet services accessible by HTTP.
+        *                          Note: this should only be used when the target URL is trusted,
+        *                          to avoid attacks on intranet services accessible by HTTP.
         *    - userAgent           A user agent, if you want to override the default
         *                          MediaWiki/$wgVersion
         *    - logger              A \Psr\Logger\LoggerInterface instance for debug logging
index e041fdd..fc5611b 100644 (file)
@@ -496,8 +496,8 @@ class PostgresUpdater extends DatabaseUpdater {
                $q = <<<END
 SELECT attname, attnum FROM pg_namespace, pg_class, pg_attribute
        WHERE pg_class.relnamespace = pg_namespace.oid
-         AND attrelid=pg_class.oid AND attnum > 0
-         AND relname=%s AND nspname=%s
+               AND attrelid=pg_class.oid AND attnum > 0
+               AND relname=%s AND nspname=%s
 END;
                $res = $this->db->query( sprintf( $q,
                        $this->db->addQuotes( $table ),
@@ -523,9 +523,9 @@ END;
                $q = <<<END
 SELECT indkey, indrelid FROM pg_namespace, pg_class, pg_index
        WHERE nspname=%s
-         AND pg_class.relnamespace = pg_namespace.oid
-         AND relname=%s
-         AND indexrelid=pg_class.oid
+               AND pg_class.relnamespace = pg_namespace.oid
+               AND relname=%s
+               AND indexrelid=pg_class.oid
 END;
                $res = $this->db->query(
                        sprintf(
@@ -551,8 +551,8 @@ END;
                        $query = <<<END
 SELECT attname FROM pg_class, pg_attribute
        WHERE attrelid=$relid
-         AND attnum=%d
-         AND attrelid=pg_class.oid
+               AND attnum=%d
+               AND attrelid=pg_class.oid
 END;
                        $r2 = $this->db->query( sprintf( $query, $rid ) );
                        if ( !$r2 ) {
@@ -572,8 +572,8 @@ END;
                $q = <<<END
 SELECT confdeltype FROM pg_constraint, pg_namespace
        WHERE connamespace=pg_namespace.oid
-         AND nspname=%s
-         AND conname=%s;
+               AND nspname=%s
+               AND conname=%s;
 END;
                $r = $this->db->query(
                        sprintf(
@@ -594,8 +594,8 @@ END;
                $q = <<<END
 SELECT definition FROM pg_rules
        WHERE schemaname = %s
-         AND tablename = %s
-         AND rulename = %s
+               AND tablename = %s
+               AND rulename = %s
 END;
                $r = $this->db->query(
                        sprintf(
index c5c4a7c..0fe7068 100644 (file)
@@ -244,9 +244,9 @@ class SqliteInstaller extends DatabaseInstaller {
                        $sql =
 <<<EOT
        CREATE TABLE IF NOT EXISTS objectcache (
-         keyname BLOB NOT NULL default '' PRIMARY KEY,
-         value BLOB,
-         exptime TEXT
+               keyname BLOB NOT NULL default '' PRIMARY KEY,
+               value BLOB,
+               exptime TEXT
        )
 EOT;
                        $conn->query( $sql );
index 62fe785..e4eb255 100644 (file)
@@ -299,9 +299,9 @@ class WebInstallerOutput {
 
 <div id="mw-panel">
        <div class="portal" id="p-logo">
-         <a style="background-image: url(images/installer-logo.png);"
-               href="https://www.mediawiki.org/"
-               title="Main Page"></a>
+               <a style="background-image: url(images/installer-logo.png);"
+                       href="https://www.mediawiki.org/"
+                       title="Main Page"></a>
        </div>
 <?php
        $message = wfMessage( 'config-sidebar' )->plain();
index 25a271c..c2c9d66 100644 (file)
@@ -793,9 +793,9 @@ LUA;
        private function getGlobalKey( $name ) {
                $parts = [ 'global', 'jobqueue', $name ];
                foreach ( $parts as $part ) {
-                   if ( !preg_match( '/[a-zA-Z0-9_-]+/', $part ) ) {
-                       throw new InvalidArgumentException( "Key part characters are out of range." );
-                   }
+                       if ( !preg_match( '/[a-zA-Z0-9_-]+/', $part ) ) {
+                               throw new InvalidArgumentException( "Key part characters are out of range." );
+                       }
                }
 
                return implode( ':', $parts );
index 651a332..f9284a5 100644 (file)
@@ -29,7 +29,7 @@ use MediaWiki\MediaWikiServices;
  *   - a) Recursive jobs to update links for backlink pages for a given title.
  *        These jobs have (recursive:true,table:<table>) set.
  *   - b) Jobs to update links for a set of pages (the job title is ignored).
- *           These jobs have (pages:(<page ID>:(<namespace>,<title>),...) set.
+ *        These jobs have (pages:(<page ID>:(<namespace>,<title>),...) set.
  *   - c) Jobs to update links for a single page (the job title)
  *        These jobs need no extra fields set.
  *
index 7f50055..1c12a1c 100644 (file)
@@ -33,7 +33,7 @@
  * For example, if templates A and B are edited (at the same time) the queue will have:
  *     (A base, B base)
  * When these jobs run, the queue will have per-title and remnant partition jobs:
- *        (titleX,titleY,titleZ,...,A remnant,titleM,titleN,titleO,...,B remnant)
+ *     (titleX,titleY,titleZ,...,A remnant,titleM,titleN,titleO,...,B remnant)
  *
  * This works best when the queue is FIFO, for several reasons:
  *   - a) Since the remnant jobs are enqueued after the leaf jobs, the slower leaf jobs have to
@@ -133,7 +133,7 @@ class BacklinkJobUtils {
                                        'table'         => $params['table'],
                                        'range'         => [
                                                'start'     => $ranges[1][0],
-                                               'end'       => $ranges[count( $ranges ) - 1][1],
+                                               'end'       => $ranges[count( $ranges ) - 1][1],
                                                'batchSize' => $realBSize,
                                                'subranges' => array_slice( $ranges, 1 )
                                        ],
index bc99672..9d84610 100644 (file)
@@ -8,7 +8,7 @@
  * not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *             http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software distributed
  * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
index 4c86757..6b3e4a7 100644 (file)
@@ -197,11 +197,11 @@ class CryptHKDF {
         * From http://eprint.iacr.org/2010/264.pdf:
         *
         * The scheme HKDF is specifed as:
-        *      HKDF(XTS, SKM, CTXinfo, L) = K(1) || K(2) || ... || K(t)
+        *   HKDF(XTS, SKM, CTXinfo, L) = K(1) || K(2) || ... || K(t)
         * where the values K(i) are defined as follows:
-        *      PRK = HMAC(XTS, SKM)
-        *      K(1) = HMAC(PRK, CTXinfo || 0);
-        *      K(i+1) = HMAC(PRK, K(i) || CTXinfo || i), 1 <= i < t;
+        *   PRK = HMAC(XTS, SKM)
+        *   K(1) = HMAC(PRK, CTXinfo || 0);
+        *   K(i+1) = HMAC(PRK, K(i) || CTXinfo || i), 1 <= i < t;
         * where t = [L/k] and the value K(t) is truncated to its first d = L mod k bits;
         * the counter i is non-wrapping and of a given fixed size, e.g., a single byte.
         * Note that the length of the HMAC output is the same as its key length and therefore
index db085da..ba55baf 100644 (file)
@@ -85,7 +85,7 @@ class StatusValue {
         * defined as:
         * [
         *     0 => object(StatusValue) # the StatusValue with error messages, only
-        *         1 => object(StatusValue) # The StatusValue with warning messages, only
+        *     1 => object(StatusValue) # The StatusValue with warning messages, only
         * ]
         *
         * @return StatusValue[]
index 5edd889..2468f38 100644 (file)
@@ -95,9 +95,9 @@ application/vnd.ms-powerpoint [OFFICE]
 application/x-director         [OFFICE]
 text/rtf                       [OFFICE]
 
-application/vnd.openxmlformats-officedocument.wordprocessingml.document        [OFFICE]
+application/vnd.openxmlformats-officedocument.wordprocessingml.document        [OFFICE]
 application/vnd.openxmlformats-officedocument.wordprocessingml.template                [OFFICE]
-application/vnd.ms-word.document.macroEnabled.12                               [OFFICE]
+application/vnd.ms-word.document.macroEnabled.12                               [OFFICE]
 application/vnd.ms-word.template.macroEnabled.12                               [OFFICE]
 application/vnd.openxmlformats-officedocument.presentationml.template          [OFFICE]
 application/vnd.openxmlformats-officedocument.presentationml.slideshow         [OFFICE]
index ae91be5..730eed1 100644 (file)
@@ -63,9 +63,9 @@ class RESTBagOStuff extends BagOStuff {
        protected function doGet( $key, $flags = 0 ) {
                $req = [
                        'method' => 'GET',
-                   'url' => $this->url . rawurlencode( $key ),
-
+                       'url' => $this->url . rawurlencode( $key ),
                ];
+
                list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->client->run( $req );
                if ( $rcode === 200 ) {
                        if ( is_string( $rbody ) ) {
index d84c959..98f44d1 100644 (file)
@@ -41,7 +41,7 @@ class WinCacheBagOStuff extends BagOStuff {
                $result = wincache_ucache_set( $key, serialize( $value ), $expire );
 
                /* wincache_ucache_set returns an empty array on success if $value
-                  was an array, bool otherwise */
+                * was an array, bool otherwise */
                return ( is_array( $result ) && $result === [] ) || $result;
        }
 
index 0d171f5..17d1a29 100644 (file)
@@ -647,7 +647,7 @@ class XMPReader implements LoggerAwareInterface {
        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 */
+                * in which case it could also be rdf:Description */
                if ( $this->curItem[0] !== $elm
                        && !( $elm === self::NS_RDF . ' Description'
                                && $this->mode[0] === self::MODE_STRUCT )
index 21effa0..3858f27 100644 (file)
@@ -103,9 +103,9 @@ class UserMailer {
         * @param string $subject Email's subject.
         * @param string $body Email's text or Array of two strings to be the text and html bodies
         * @param array $options:
-        *              'replyTo' MailAddress
-        *              'contentType' string default 'text/plain; charset=UTF-8'
-        *              'headers' array Extra headers to set
+        *     'replyTo' MailAddress
+        *     'contentType' string default 'text/plain; charset=UTF-8'
+        *     'headers' array Extra headers to set
         *
         * @throws MWException
         * @throws Exception
@@ -197,9 +197,9 @@ class UserMailer {
         * @param string $subject Email's subject.
         * @param string $body Email's text or Array of two strings to be the text and html bodies
         * @param array $options:
-        *              'replyTo' MailAddress
-        *              'contentType' string default 'text/plain; charset=UTF-8'
-        *              'headers' array Extra headers to set
+        *     'replyTo' MailAddress
+        *     'contentType' string default 'text/plain; charset=UTF-8'
+        *     'headers' array Extra headers to set
         *
         * @throws MWException
         * @throws Exception
index 5e8f8c8..57b5b36 100644 (file)
@@ -277,9 +277,9 @@ class DjVuImage {
                                $reg = <<<EOR
                                        /\(page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*"
                                        ((?>    # Text to match is composed of atoms of either:
-                                         \\\\. # - any escaped character
-                                         |     # - any character different from " and \
-                                         [^"\\\\]+
+                                               \\\\. # - any escaped character
+                                               |     # - any character different from " and \
+                                               [^"\\\\]+
                                        )*?)
                                        "\s*\)
                                        | # Or page can be empty ; in this case, djvutxt dumps ()
index 6c857a8..c9f0dfa 100644 (file)
@@ -112,8 +112,8 @@ class JpegHandler extends ExifBitmapHandler {
                        wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
 
                        /* This used to use 0 (ExifBitmapHandler::OLD_BROKEN_FILE) for the cases
-                        *      * No metadata in the file
-                        *      * Something is broken in the file.
+                        *   * No metadata in the file
+                        *   * Something is broken in the file.
                         * However, if the metadata support gets expanded then you can't tell if the 0 is from
                         * a broken file, or just no props found. A broken file is likely to stay broken, but
                         * a file which had no props could have props once the metadata support is improved.
index 76ee525..605a873 100644 (file)
@@ -107,7 +107,7 @@ class DateFormatter {
                $this->targets[self::ISO2] = '[[y-m-d]]';
 
                # Rules
-               #            pref    source       target
+               #            pref       source      target
                $this->rules[self::DMY][self::MD] = self::DM;
                $this->rules[self::ALL][self::MD] = self::MD;
                $this->rules[self::MDY][self::DM] = self::MD;
@@ -127,7 +127,7 @@ class DateFormatter {
         * Get a DateFormatter object
         *
         * @param Language|string|null $lang In which language to format the date
-        *              Defaults to the site content language
+        *     Defaults to the site content language
         * @return DateFormatter
         */
        public static function getInstance( $lang = null ) {
index 86aa06a..9a9b9d8 100644 (file)
@@ -1450,15 +1450,16 @@ class Parser {
                $spdash = "(?:-|$space)"; # a dash or a non-newline space
                $spaces = "$space++"; # possessive match of 1 or more spaces
                $text = preg_replace_callback(
-                       '!(?:                            # Start cases
-                               (<a[ \t\r\n>].*?</a>) |      # m[1]: Skip link text
-                               (<.*?>) |                    # m[2]: Skip stuff inside
-                                                            #       HTML elements' . "
-                               (\b(?i:$prots)($addr$urlChar*)) | # m[3]: Free external links
-                                                            # m[4]: Post-protocol path
-                               \b(?:RFC|PMID) $spaces       # m[5]: RFC or PMID, capture number
+                       '!(?:                        # Start cases
+                               (<a[ \t\r\n>].*?</a>) |    # m[1]: Skip link text
+                               (<.*?>) |                  # m[2]: Skip stuff inside HTML elements' . "
+                               (\b                        # m[3]: Free external links
+                                       (?i:$prots)
+                                       ($addr$urlChar*)         # m[4]: Post-protocol path
+                               ) |
+                               \b(?:RFC|PMID) $spaces     # m[5]: RFC or PMID, capture number
                                        ([0-9]+)\b |
-                               \bISBN $spaces (             # m[6]: ISBN, capture number
+                               \bISBN $spaces (           # m[6]: ISBN, capture number
                                        (?: 97[89] $spdash? )?   #  optional 13-digit ISBN prefix
                                        (?: [0-9]  $spdash? ){9} #  9 digits with opt. delimiters
                                        [0-9Xx]                  #  check digit
index a4100bb..210deb1 100644 (file)
@@ -23,11 +23,11 @@ interface Processor {
 
        /**
         * @return array With following keys:
-        *              'globals' - variables to be set to $GLOBALS
-        *              'defines' - constants to define
-        *              'callbacks' - functions to be executed by the registry
-        *              'credits' - metadata to be stored by registry
-        *              'attributes' - registration info which isn't a global variable
+        *     'globals' - variables to be set to $GLOBALS
+        *     'defines' - constants to define
+        *     'callbacks' - functions to be executed by the registry
+        *     'credits' - metadata to be stored by registry
+        *     'attributes' - registration info which isn't a global variable
         */
        public function getExtractedInfo();
 
index 5aaaa1b..a31551c 100644 (file)
@@ -87,17 +87,17 @@ class VersionChecker {
         * installed extensions in the $credits array.
         *
         * Example $extDependencies:
-        *      {
-        *              'FooBar' => {
-        *                      'MediaWiki' => '>= 1.25.0',
-        *                      'extensions' => {
-        *                              'FooBaz' => '>= 1.25.0'
-        *                      },
-        *                      'skins' => {
-        *                              'BazBar' => '>= 1.0.0'
-        *                      }
-        *              }
-        *      }
+        *     {
+        *       'FooBar' => {
+        *         'MediaWiki' => '>= 1.25.0',
+        *         'extensions' => {
+        *           'FooBaz' => '>= 1.25.0'
+        *         },
+        *         'skins' => {
+        *           'BazBar' => '>= 1.0.0'
+        *         }
+        *       }
+        *     }
         *
         * @param array $extDependencies All extensions that depend on other ones
         * @return array
index 8a06b65..910fd77 100644 (file)
@@ -93,7 +93,7 @@ abstract class SearchIndexFieldDefinition implements SearchIndexField {
        public function merge( SearchIndexField $that ) {
                // TODO: which definitions may be compatible?
                if ( ( $that instanceof self ) && $this->type === $that->type &&
-                    $this->flags === $that->flags && $this->type !== self::INDEX_TYPE_NESTED
+                       $this->flags === $that->flags && $this->type !== self::INDEX_TYPE_NESTED
                ) {
                        return $that;
                }
index 3ab0f43..c6990fe 100644 (file)
@@ -91,9 +91,9 @@ interface SessionManagerInterface extends LoggerAwareInterface {
         *
         * The return value is such that someone could theoretically do this:
         * @code
-        *  foreach ( $provider->getVaryHeaders() as $header => $options ) {
-        *      $outputPage->addVaryHeader( $header, $options );
-        *  }
+        * foreach ( $provider->getVaryHeaders() as $header => $options ) {
+        *   $outputPage->addVaryHeader( $header, $options );
+        * }
         * @endcode
         *
         * @return array
index 61c7500..e8d81cb 100644 (file)
@@ -397,9 +397,9 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         *
         * The return value is such that someone could theoretically do this:
         * @code
-        *  foreach ( $provider->getVaryHeaders() as $header => $options ) {
-        *      $outputPage->addVaryHeader( $header, $options );
-        *  }
+        * foreach ( $provider->getVaryHeaders() as $header => $options ) {
+        *   $outputPage->addVaryHeader( $header, $options );
+        * }
         * @endcode
         *
         * @protected For use by \MediaWiki\Session\SessionManager only
index eef421c..61d34c6 100644 (file)
@@ -324,12 +324,12 @@ abstract class BaseTemplate extends QuickTemplate {
         *
         * If a "data" key is present, it must be an array, where the keys represent
         * the data-xxx properties with their provided values. For example,
-        *  $item['data'] = [
-        *       'foo' => 1,
-        *       'bar' => 'baz',
-        *  ];
+        *     $item['data'] = [
+        *       'foo' => 1,
+        *       'bar' => 'baz',
+        *     ];
         * will render as element properties:
-        *  data-foo='1' data-bar='baz'
+        *     data-foo='1' data-bar='baz'
         *
         * @param array $options Can be used to affect the output of a link.
         * Possible options are:
index c3ee321..fb8aa04 100644 (file)
@@ -702,7 +702,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
         */
        protected function getFakeTemplate( $msg, $msgType ) {
                global $wgAuth, $wgEnableEmail, $wgHiddenPrefs, $wgEmailConfirmToEdit, $wgEnableUserEmail,
-                          $wgSecureLogin, $wgPasswordResetRoutes;
+                       $wgSecureLogin, $wgPasswordResetRoutes;
 
                // make a best effort to get the value of fields which used to be fixed in the old login
                // template but now might or might not exist depending on what providers are used
@@ -772,7 +772,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                $resetLink = $this->isSignup()
                        ? null
                        : is_array( $wgPasswordResetRoutes )
-                         && in_array( true, array_values( $wgPasswordResetRoutes ), true );
+                               && in_array( true, array_values( $wgPasswordResetRoutes ), true );
 
                $template->set( 'header', '' );
                $template->set( 'formheader', '' );
index 975e210..72b9567 100644 (file)
@@ -817,9 +817,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
        function filterOnUserExperienceLevel( &$tables, &$conds, &$join_conds, $opts ) {
                global $wgLearnerEdits,
-                          $wgExperiencedUserEdits,
-                          $wgLearnerMemberSince,
-                          $wgExperiencedUserMemberSince;
+                       $wgExperiencedUserEdits,
+                       $wgLearnerMemberSince,
+                       $wgExperiencedUserMemberSince;
 
                $selectedExpLevels = explode( ',', strtolower( $opts['userExpLevel'] ) );
                // remove values that are not recognized
index a7a1c58..19850e6 100644 (file)
@@ -95,9 +95,11 @@ class SpecialStatistics extends SpecialPage {
                        if ( !$msg->isDisabled() ) {
                                $descriptionHtml = $this->msg( 'parentheses' )->rawParams( $msg->parse() )
                                        ->escaped();
-                               $text .= "<br />" .
-                                         Html::rawElement( 'small', [ 'class' => 'mw-statistic-desc' ],
-                                                                               " $descriptionHtml" );
+                               $text .= "<br />" . Html::rawElement(
+                                       'small',
+                                       [ 'class' => 'mw-statistic-desc' ],
+                                       " $descriptionHtml"
+                               );
                        }
                }
 
index 8da1553..3467b49 100644 (file)
@@ -1824,7 +1824,7 @@ class Balancer {
         * Regex borrowed from Tim Starling's "remex-html" project.
         */
        const VALID_COMMENT_REGEX = "~ !--
-               (                             # 1. Comment match detector
+               (                           # 1. Comment match detector
                        > | -> | # Invalid short close
                        (                         # 2. Comment contents
                                (?:
@@ -1839,15 +1839,15 @@ class Balancer {
                        (                         # 3. Comment close
                                --> |   # Normal close
                                --!> |  # Comment end bang
-                               (                     # 4. Indicate matches requiring EOF
-                                       --! |   # EOF in comment end bang state
-                                       -- |    # EOF in comment end state
-                                       -  |    # EOF in comment end dash state
-                                               # EOF in comment state
+                               (                       # 4. Indicate matches requiring EOF
+                                       --! |                   # EOF in comment end bang state
+                                       -- |                    # EOF in comment end state
+                                       -  |                    # EOF in comment end dash state
+                                       (?#nothing)             # EOF in comment state
                                )
                        )
                )
-               ([^<]*) \z                    # 5. Non-tag text after the comment
+               ([^<]*) \z                  # 5. Non-tag text after the comment
                ~xs";
 
        /**
index d9c2a58..e510736 100644 (file)
@@ -3777,9 +3777,9 @@ class User implements IDBAccessObject {
         */
        public function getExperienceLevel() {
                global $wgLearnerEdits,
-                          $wgExperiencedUserEdits,
-                          $wgLearnerMemberSince,
-                          $wgExperiencedUserMemberSince;
+                       $wgExperiencedUserEdits,
+                       $wgLearnerMemberSince,
+                       $wgExperiencedUserMemberSince;
 
                if ( $this->isAnon() ) {
                        return false;
index ef2c14a..43bccba 100644 (file)
@@ -230,7 +230,7 @@ class BatchRowIterator implements RecursiveIterator {
         * `=` conditions while the final key uses a `>` condition
         *
         * Example output:
-        *        [ '( foo = 42 AND bar > 7 ) OR ( foo > 42 )' ]
+        *     [ '( foo = 42 AND bar > 7 ) OR ( foo > 42 )' ]
         *
         * @return array The SQL conditions necessary to select the next set
         *  of rows in the batched query
index 3bddd77..1c8d486 100644 (file)
@@ -47,11 +47,11 @@ class MWCryptHKDF {
         * From http://eprint.iacr.org/2010/264.pdf:
         *
         * The scheme HKDF is specifed as:
-        *      HKDF(XTS, SKM, CTXinfo, L) = K(1) || K(2) || ... || K(t)
+        *   HKDF(XTS, SKM, CTXinfo, L) = K(1) || K(2) || ... || K(t)
         * where the values K(i) are defined as follows:
-        *      PRK = HMAC(XTS, SKM)
-        *      K(1) = HMAC(PRK, CTXinfo || 0);
-        *      K(i+1) = HMAC(PRK, K(i) || CTXinfo || i), 1 <= i < t;
+        *   PRK = HMAC(XTS, SKM)
+        *   K(1) = HMAC(PRK, CTXinfo || 0);
+        *   K(i+1) = HMAC(PRK, K(i) || CTXinfo || i), 1 <= i < t;
         * where t = [L/k] and the value K(t) is truncated to its first d = L mod k bits;
         * the counter i is non-wrapping and of a given fixed size, e.g., a single byte.
         * Note that the length of the HMAC output is the same as its key length and therefore
index a1cc4bc..c1cb62c 100644 (file)
@@ -2158,12 +2158,10 @@ class Language {
         * the date preference they're supposed to use, it should be used in
         * all children.
         *
-        *<code>
-        * function timeanddate([...], $format = true) {
-        *      $datePreference = $this->dateFormat($format);
-        * [...]
-        * }
-        *</code>
+        *     function timeanddate([...], $format = true) {
+        *       $datePreference = $this->dateFormat($format);
+        *       [...]
+        *     }
         *
         * @param int|string|bool $usePrefs If true, the user's preference is used
         *   if false, the site/language default is used
index 06fec44..cef9552 100644 (file)
@@ -99,13 +99,13 @@ class LanguageConverter {
                        // '+' add rules for alltext
                        // 'E' the gave flags is error
                        // these flags above are reserved for program
-                       'A' => 'A',       // add rule for convert code (all text convert)
-                       'T' => 'T',       // title convert
-                       'R' => 'R',       // raw content
-                       'D' => 'D',       // convert description (subclass implement)
-                       '-' => '-',       // remove convert (not implement)
-                       'H' => 'H',       // add rule for convert code (but no display in placed code)
-                       'N' => 'N'        // current variant name
+                       'A' => 'A',   // add rule for convert code (all text convert)
+                       'T' => 'T',   // title convert
+                       'R' => 'R',   // raw content
+                       'D' => 'D',   // convert description (subclass implement)
+                       '-' => '-',   // remove convert (not implement)
+                       'H' => 'H',   // add rule for convert code (but no display in placed code)
+                       'N' => 'N',   // current variant name
                ];
                $this->mFlags = array_merge( $defaultflags, $flags );
                foreach ( $this->mVariants as $v ) {
@@ -357,10 +357,10 @@ class LanguageConverter {
                }
 
                /* we convert everything except:
-                  1. HTML markups (anything between < and >)
-                  2. HTML entities
-                  3. placeholders created by the parser
-               */
+                * 1. HTML markups (anything between < and >)
+                * 2. HTML entities
+                * 3. placeholders created by the parser
+                */
                $marker = '|' . Parser::MARKER_PREFIX . '[\-a-zA-Z0-9]+';
 
                // this one is needed when the text is inside an HTML markup
@@ -1085,12 +1085,12 @@ class LanguageConverter {
                        // text should be splited by ";" only if a valid variant
                        // name exist after the markup, for example:
                        //  -{zh-hans:<span style="font-size:120%;">xxx</span>;zh-hant:\
-                       //      <span style="font-size:120%;">yyy</span>;}-
+                       //  <span style="font-size:120%;">yyy</span>;}-
                        // we should split it as:
                        //  [
-                       //        [0] => 'zh-hans:<span style="font-size:120%;">xxx</span>'
-                       //        [1] => 'zh-hant:<span style="font-size:120%;">yyy</span>'
-                       //        [2] => ''
+                       //    [0] => 'zh-hans:<span style="font-size:120%;">xxx</span>'
+                       //    [1] => 'zh-hant:<span style="font-size:120%;">yyy</span>'
+                       //    [2] => ''
                        //  ]
                        $pat = '/;\s*(?=';
                        foreach ( $this->mVariants as $variant ) {
index 76568c2..9ef53e5 100644 (file)
@@ -63,13 +63,11 @@ class LanguageKsh extends Language {
         *
         * Possible values for the type of genitive are:
         *      Sing, Iehr            prepositioned genitive = possessive dative
-        *      Vun, Fon, -omitted-   postpositioned genitive
-        *                                     = preposition "vun" with dative
+        *      Vun, Fon, -omitted-   postpositioned genitive = preposition "vun" with dative
         *
         * Values of case overrides & prepositions, in the order of preceedence:
         *      Sing, Iehr            possessive dative = prepositioned genitive
-        *      Vun, Fon              preposition "vun" with dative
-        *                                           = postpositioned genitive
+        *      Vun, Fon              preposition "vun" with dative = postpositioned genitive
         *      En, em                preposition "en" with dative
         *
         * Values for object gender specifiers of the possessive dative, or
index d1963e1..f4082af 100644 (file)
@@ -50,12 +50,12 @@ class LanguageLa extends Language {
                case 'genitive':
                        // only a few declensions, and even for those mostly the singular only
                        $in = [
-                               '/u[ms]$/',                     # 2nd declension singular
-                               '/ommunia$/',                   # 3rd declension neuter plural (partly)
-                               '/a$/',                         # 1st declension singular
+                               '/u[ms]$/',                          # 2nd declension singular
+                               '/ommunia$/',                        # 3rd declension neuter plural (partly)
+                               '/a$/',                              # 1st declension singular
                                '/libri$/', '/nuntii$/', '/datae$/', # 2nd declension plural (partly)
-                               '/tio$/', '/ns$/', '/as$/',     # 3rd declension singular (partly)
-                               '/es$/'                         # 5th declension singular
+                               '/tio$/', '/ns$/', '/as$/',          # 3rd declension singular (partly)
+                               '/es$/'                              # 5th declension singular
                        ];
                        $out = [
                                'i',
@@ -69,12 +69,12 @@ class LanguageLa extends Language {
                case 'accusative':
                        // only a few declensions, and even for those mostly the singular only
                        $in = [
-                               '/u[ms]$/',                     # 2nd declension singular
-                               '/a$/',                         # 1st declension singular
-                               '/ommuniam$/',              # 3rd declension neuter plural (partly)
+                               '/u[ms]$/',                          # 2nd declension singular
+                               '/a$/',                              # 1st declension singular
+                               '/ommuniam$/',                       # 3rd declension neuter plural (partly)
                                '/libri$/', '/nuntii$/', '/datam$/', # 2nd declension plural (partly)
-                               '/tio$/', '/ns$/', '/as$/',     # 3rd declension singular (partly)
-                               '/es$/'                         # 5th declension singular
+                               '/tio$/', '/ns$/', '/as$/',          # 3rd declension singular (partly)
+                               '/es$/'                              # 5th declension singular
                        ];
                        $out = [
                                'um',
@@ -88,12 +88,12 @@ class LanguageLa extends Language {
                case 'ablative':
                        // only a few declensions, and even for those mostly the singular only
                        $in = [
-                               '/u[ms]$/',                     # 2nd declension singular
-                               '/ommunia$/',                   # 3rd declension neuter plural (partly)
-                               '/a$/',                         # 1st declension singular
-                               '/libri$/', '/nuntii$/', '/data$/', # 2nd declension plural (partly)
-                               '/tio$/', '/ns$/', '/as$/',     # 3rd declension singular (partly)
-                               '/es$/'                         # 5th declension singular
+                               '/u[ms]$/',                          # 2nd declension singular
+                               '/ommunia$/',                        # 3rd declension neuter plural (partly)
+                               '/a$/',                              # 1st declension singular
+                               '/libri$/', '/nuntii$/', '/data$/',  # 2nd declension plural (partly)
+                               '/tio$/', '/ns$/', '/as$/',          # 3rd declension singular (partly)
+                               '/es$/'                              # 5th declension singular
                        ];
                        $out = [
                                'o',
index 689586b..b9280ea 100644 (file)
@@ -105,7 +105,7 @@ $namespaceAliases = [];
  * Example:
  * @code
  * $namespaceGenderAliases = [
- *     NS_USER => [ 'male' => 'Male_user', 'female' => 'Female_user' ],
+ *   NS_USER => [ 'male' => 'Male_user', 'female' => 'Female_user' ],
  * ];
  * @endcode
  */
index a0fe381..2a102b2 100644 (file)
@@ -106,7 +106,7 @@ class HHVMMakeRepo extends Maintenance {
                $cmd = wfEscapeShellArg(
                        $hhvm,
                        '--hphp',
-                   '--target', 'hhbc',
+                       '--target', 'hhbc',
                        '--format', 'binary',
                        '--force', '1',
                        '--keep-tempdir', '1',
index 4a3d2d6..23bdb3f 100644 (file)
@@ -497,7 +497,7 @@ class ImportImages extends Maintenance {
        # (preferably batching files too).
        private function getFileCommentFromSourceWiki( $wiki_host, $file ) {
                $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:'
-                          . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
+                       . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
                $body = Http::get( $url, [], __METHOD__ );
                if ( preg_match( '#<ii comment="([^"]*)" />#', $body, $matches ) == 0 ) {
                        return false;
@@ -508,7 +508,7 @@ class ImportImages extends Maintenance {
 
        private function getFileUserFromSourceWiki( $wiki_host, $file ) {
                $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:'
-                          . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
+                       . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
                $body = Http::get( $url, [], __METHOD__ );
                if ( preg_match( '#<ii user="([^"]*)" />#', $body, $matches ) == 0 ) {
                        return false;
index 9893342..69c9265 100644 (file)
@@ -195,7 +195,7 @@ class UserDupes {
                        "SELECT user_name,COUNT(*) AS n
                                FROM $user
                        GROUP BY user_name
-                         HAVING n > 1", __METHOD__ );
+                               HAVING n > 1", __METHOD__ );
 
                $list = [];
                foreach ( $result as $row ) {
index b791db8..a6cd650 100644 (file)
@@ -13,7 +13,7 @@
        list-style: none none;
        display: inline;
        /* shared.css has some very weird directionality-specific rules for 'ul' we need to override,
-          search for "Correct directionality when page dir is different from site/user dir" */
+        * search for "Correct directionality when page dir is different from site/user dir" */
        margin: 0 !important;
        padding: 0 !important;
 }
index d58eb2e..2afe286 100644 (file)
                                        // For example, see two groups with conflicts:
                                        // userExpLevel: [
                                        //   {
-                                       //      name: 'experienced',
-                                       //      conflicts: [ 'unregistered' ]
+                                       //     name: 'experienced',
+                                       //     conflicts: [ 'unregistered' ]
                                        //   }
                                        // ],
                                        // registration: [
                                        //   {
-                                       //      name: 'registered',
+                                       //     name: 'registered',
                                        //   },
                                        //   {
-                                       //      name: 'unregistered',
+                                       //     name: 'unregistered',
                                        //   }
                                        // ]
                                        // If we select 'experienced', then 'unregistered' is in conflict (and vice versa),
index b4fe934..0f8ae45 100644 (file)
@@ -88,8 +88,8 @@ figure[typeof*='mw:Image'] {
                display: table-caption;
                caption-side: bottom;
                /* In mw-core the font-size is duplicated, 94% in thumbiner
-                  and again 94% in thumbcaption. 88% for font size of the
-                  caption results in the same behavior. */
+                * and again 94% in thumbcaption. 88% for font size of the
+                * caption results in the same behavior. */
                font-size: 88%;
                line-height: 1.4em;
                text-align: left;
index 2e09392..95c77f8 100644 (file)
        };
 
        /**
-         * Set a value in device storage.
-         *
-         * @param {string} key Key name to store under
-         * @param {string} value Value to be stored
-         * @return {boolean} Whether the save succeeded or not
-         */
+        * Set a value in device storage.
+        *
+        * @param {string} key Key name to store under
+        * @param {string} value Value to be stored
+        * @return {boolean} Whether the save succeeded or not
+        */
        SafeStorage.prototype.set = function ( key, value ) {
                try {
                        this.store.setItem( key, value );
        };
 
        /**
-         * Remove a value from device storage.
-         *
-         * @param {string} key Key of item to remove
-         * @return {boolean} Whether the save succeeded or not
-         */
+        * Remove a value from device storage.
+        *
+        * @param {string} key Key of item to remove
+        * @return {boolean} Whether the save succeeded or not
+        */
        SafeStorage.prototype.remove = function ( key ) {
                try {
                        this.store.removeItem( key );
index 3cb8e9d..6e9ff0e 100644 (file)
@@ -89,7 +89,7 @@
 
        /**
         * @property {jQuery} $container If the gallery contained in an element that is
-        *      not the main content element, then it stores that element.
+        *   not the main content element, then it stores that element.
         */
 
        /**
 
        /**
         * @property {number} imageHeight Height of the image based on viewport size
-        *      the URLs in the required size.
+        *   the URLs in the required size.
         */
 
        /* Setup */
index 074fab0..106ab68 100644 (file)
@@ -86,9 +86,12 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
 }
 
 if ( $maintenance->getDbType() === Maintenance::DB_NONE ) {
-       if ( $wgLocalisationCacheConf['storeClass'] === false
-                && ( $wgLocalisationCacheConf['store'] == 'db'
-                         || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) )
+       if (
+               $wgLocalisationCacheConf['storeClass'] === false
+               && (
+                       $wgLocalisationCacheConf['store'] == 'db'
+                       || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory )
+               )
        ) {
                $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
        }
index 092d57b..5977652 100644 (file)
@@ -161,7 +161,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
        public function testExists() {
                // Remove the following lines when you implement this test.
                $this->markTestIncomplete(
-                 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
+                       'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
                );
        }
        */
@@ -223,7 +223,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
        public function testGetCanonicalNamespaces() {
                // Remove the following lines when you implement this test.
                $this->markTestIncomplete(
-                 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
+                       'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
                );
        }
        */
@@ -234,7 +234,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
                public function testGetCanonicalName() {
                        // Remove the following lines when you implement this test.
                        $this->markTestIncomplete(
-                         'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
+                               'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
                        );
                }
        */
@@ -245,7 +245,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
        public function testGetCanonicalIndex() {
                // Remove the following lines when you implement this test.
                $this->markTestIncomplete(
-                 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
+                       'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
                );
        }
        */
@@ -257,7 +257,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
        public function testGetValidNamespaces() {
                // Remove the following lines when you implement this test.
                $this->markTestIncomplete(
-                 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
+                       'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
                );
        }
        */
index 2694b85..424218e 100644 (file)
@@ -315,14 +315,14 @@ class MessageTest extends MediaWikiLangTestCase {
                return [
                        [ '<span>foo</span>', 'parse', '<span>foo</span>', '<span>foo</span>' ],
                        [ '<span>foo</span>', 'escaped', '&lt;span&gt;foo&lt;/span&gt;',
-                         '<span>foo</span>' ],
+                               '<span>foo</span>' ],
                        [ '<span>foo</span>', 'plain', '<span>foo</span>', '<span>foo</span>' ],
                        [ '<script>alert(1)</script>', 'parse', '&lt;script&gt;alert(1)&lt;/script&gt;',
                                '&lt;script&gt;alert(1)&lt;/script&gt;' ],
                        [ '<script>alert(1)</script>', 'escaped', '&lt;script&gt;alert(1)&lt;/script&gt;',
                                '&lt;script&gt;alert(1)&lt;/script&gt;' ],
                        [ '<script>alert(1)</script>', 'plain', '<script>alert(1)</script>',
-                         '&lt;script&gt;alert(1)&lt;/script&gt;' ],
+                               '&lt;script&gt;alert(1)&lt;/script&gt;' ],
                ];
        }
 
index ae66253..a3d1dda 100644 (file)
@@ -434,8 +434,13 @@ class ContentHandlerTest extends MediaWikiTestCase {
                $page = new WikiPage( $title );
 
                $this->setTemporaryHook( 'SearchDataForIndex',
-                       function ( &$fields, ContentHandler $handler, WikiPage $page, ParserOutput $output,
-                                          SearchEngine $engine ) {
+                       function (
+                               &$fields,
+                               ContentHandler $handler,
+                               WikiPage $page,
+                               ParserOutput $output,
+                               SearchEngine $engine
+                       ) {
                                $fields['testDataField'] = 'test content';
                        } );
 
index 4b857ce..8b285cb 100644 (file)
@@ -157,12 +157,12 @@ class LBFactoryTest extends MediaWikiTestCase {
                                ],
                        ],
                        'serverTemplate' => [
-                               'dbname'          => $wgDBname,
-                               'user'            => $wgDBuser,
-                               'password'        => $wgDBpassword,
-                               'type'            => $wgDBtype,
+                               'dbname'      => $wgDBname,
+                               'user'        => $wgDBuser,
+                               'password'    => $wgDBpassword,
+                               'type'        => $wgDBtype,
                                'dbDirectory' => $wgSQLiteDataDir,
-                               'flags'           => DBO_DEFAULT
+                               'flags'       => DBO_DEFAULT
                        ],
                        'hostsByName' => [
                                'test-db1'  => $wgDBserver,
index ebeb109..f722fe1 100644 (file)
@@ -27,7 +27,7 @@ class RESTBagOStuffTest extends MediaWikiTestCase {
                $this->client->expects( $this->once() )->method( 'run' )->with( [
                        'method' => 'GET',
                        'url' => 'http://test/rest/42xyz42'
-                   // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr )
+                       // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr )
                ] )->willReturn( [ 200, 'OK', [], 's:8:"somedata";', 0 ] );
                $result = $this->bag->get( '42xyz42' );
                $this->assertEquals( 'somedata', $result );
@@ -69,7 +69,7 @@ class RESTBagOStuffTest extends MediaWikiTestCase {
                $this->client->expects( $this->once() )->method( 'run' )->with( [
                        'method' => 'PUT',
                        'url' => 'http://test/rest/42xyz42',
-                   'body' => 's:8:"postdata";'
+                       'body' => 's:8:"postdata";'
                        // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr )
                ] )->willReturn( [ 200, 'OK', [], 'Done', 0 ] );
                $result = $this->bag->set( '42xyz42', 'postdata' );
index ec046a7..9c10e49 100644 (file)
@@ -10,7 +10,7 @@ class SearchIndexFieldTest extends MediaWikiTestCase {
                return [
                        [ 0, 'test', 0, 'test', true ],
                        [ SearchIndexField::INDEX_TYPE_NESTED, 'test',
-                         SearchIndexField::INDEX_TYPE_NESTED, 'test', false ],
+                               SearchIndexField::INDEX_TYPE_NESTED, 'test', false ],
                        [ 0, 'test', 0, 'test2', true ],
                        [ 0, 'test', 1, 'test', false ],
                ];
index 60d4e99..8b54b72 100644 (file)
@@ -45,7 +45,7 @@ class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
                                $last_timestamp_bin,
                                $timestamp_bin,
                                "timestamp ($timestamp_bin) of current ID ($id_bin) >= timestamp ($last_timestamp_bin) " .
-                                 "of prior one ($lastId_bin)" );
+                                       "of prior one ($lastId_bin)" );
 
                        $hostbits_bin = substr( $id_bin, -$hostbits );
                        $last_hostbits_bin = substr( $lastId_bin, -$hostbits );
@@ -55,7 +55,7 @@ class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
                                        $hostbits_bin,
                                        $last_hostbits_bin,
                                        "Host ID ($hostbits_bin) of current ID ($id_bin) is same as host ID ($last_hostbits_bin) " .
-                                         "of prior one ($lastId_bin)." );
+                                               "of prior one ($lastId_bin)." );
                        }
 
                        $lastId = $id;
index 11a25c4..7babcac 100644 (file)
@@ -35,8 +35,7 @@
                        <directory>structure</directory>
                        <file>suites/LessTestSuite.php</file>
                </testsuite>
-               <!-- As there is a class Maintenance, we cannot use the
-                    name "maintenance" directly -->
+               <!-- As there is a class Maintenance, we cannot use the name "maintenance" directly -->
                <testsuite name="maintenance_suite">
                        <directory>maintenance</directory>
                </testsuite>