Make lines short to pass phpcs in files under maintenance/
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sun, 27 Sep 2015 07:41:06 +0000 (10:41 +0300)
committerUmherirrender <umherirrender_de.wp@web.de>
Sun, 27 Sep 2015 15:48:56 +0000 (15:48 +0000)
Bug: T102614
Change-Id: Ieab3773a9ff8328e3672478a82ab31d8710fa8e2

maintenance/Maintenance.php
maintenance/backupTextPass.inc
maintenance/checkComposerLockUpToDate.php
maintenance/fetchText.php
maintenance/findHooks.php

index dd4ae8d..8dad5dc 100644 (file)
@@ -1108,7 +1108,15 @@ abstract class Maintenance {
         */
        private function lockSearchindex( $db ) {
                $write = array( 'searchindex' );
-               $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user', 'page_restrictions' );
+               $read = array(
+                       'page',
+                       'revision',
+                       'text',
+                       'interwiki',
+                       'l10n_cache',
+                       'user',
+                       'page_restrictions'
+               );
                $db->lockTables( $read, $write, __CLASS__ . '::' . __METHOD__ );
        }
 
index 27be5fd..11a0590 100644 (file)
@@ -464,8 +464,9 @@ class TextPassDumper extends BackupDumper {
         * is thrown.
         *
         * @param string $id The revision id to get the text for
-        * @param string|bool|null $model The content model used to determine applicable export transformations.
-        *      If $model is null, it will be determined from the database.
+        * @param string|bool|null $model The content model used to determine
+        *  applicable export transformations.
+        *  If $model is null, it will be determined from the database.
         * @param string|null $format The content format used when applying export transformations.
         *
         * @throws MWException
index 4772071..7a85d64 100644 (file)
@@ -12,7 +12,8 @@ require_once __DIR__ . '/Maintenance.php';
 class CheckComposerLockUpToDate extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = 'Checks whether your composer.lock file is up to date with the current composer.json';
+               $this->mDescription =
+                       'Checks whether your composer.lock file is up to date with the current composer.json';
        }
 
        public function execute() {
@@ -23,7 +24,10 @@ class CheckComposerLockUpToDate extends Maintenance {
                        // Maybe they're using mediawiki/vendor?
                        $lockLocation = "$IP/vendor/composer.lock";
                        if ( !file_exists( $lockLocation ) ) {
-                               $this->error( 'Could not find composer.lock file. Have you run "composer install"?', 1 );
+                               $this->error(
+                                       'Could not find composer.lock file. Have you run "composer install"?',
+                                       1
+                               );
                        }
                }
 
@@ -40,7 +44,9 @@ class CheckComposerLockUpToDate extends Maintenance {
                foreach ( $json->getRequiredDependencies() as $name => $version ) {
                        if ( isset( $installed[$name] ) ) {
                                if ( $installed[$name]['version'] !== $version ) {
-                                       $this->output( "$name: {$installed[$name]['version']} installed, $version required.\n" );
+                                       $this->output(
+                                               "$name: {$installed[$name]['version']} installed, $version required.\n"
+                                       );
                                        $found = true;
                                }
                        } else {
@@ -49,9 +55,14 @@ class CheckComposerLockUpToDate extends Maintenance {
                        }
                }
                if ( $found ) {
-                       $this->error( 'Error: your composer.lock file is not up to date, run "composer update" to install newer dependencies', 1 );
+                       $this->error(
+                               'Error: your composer.lock file is not up to date. ' .
+                                       'Run "composer update" to install newer dependencies',
+                               1
+                       );
                } else {
-                       // The hash is the entire composer.json file, so it can be updated without any of the dependencies changing
+                       // The hash is the entire composer.json file,
+                       // so it can be updated without any of the dependencies changing
                        // We couldn't find any out-of-date dependencies, so assume everything is ok!
                        $this->output( "Your composer.lock file is up to date with current dependencies!\n" );
                }
index dd4f760..983b772 100644 (file)
@@ -32,8 +32,9 @@ require_once __DIR__ . '/Maintenance.php';
 class FetchText extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Fetch the raw revision blob from an old_id.";
-               $this->mDescription .= "\nNOTE: Export transformations are NOT applied. This is left to backupTextPass.php";
+               $this->mDescription = "Fetch the raw revision blob from an old_id.\n" .
+                       "NOTE: Export transformations are NOT applied. " .
+                       "This is left to backupTextPass.php";
        }
 
        /**
index 114366b..0925406 100644 (file)
@@ -190,7 +190,11 @@ class FindHooks extends Maintenance {
 
                $retval = array();
                while ( true ) {
-                       $json = Http::get( wfAppendQuery( 'http://www.mediawiki.org/w/api.php', $params ), array(), __METHOD__ );
+                       $json = Http::get(
+                               wfAppendQuery( 'http://www.mediawiki.org/w/api.php', $params ),
+                               array(),
+                               __METHOD__
+                       );
                        $data = FormatJson::decode( $json, true );
                        foreach ( $data['query']['categorymembers'] as $page ) {
                                if ( preg_match( '/Manual\:Hooks\/([a-zA-Z0-9- :]+)/', $page['title'], $m ) ) {