From 34a07796c16a3d345f1e95e9696018e25062f64b Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sun, 27 Sep 2015 10:41:06 +0300 Subject: [PATCH] Make lines short to pass phpcs in files under maintenance/ Bug: T102614 Change-Id: Ieab3773a9ff8328e3672478a82ab31d8710fa8e2 --- maintenance/Maintenance.php | 10 +++++++++- maintenance/backupTextPass.inc | 5 +++-- maintenance/checkComposerLockUpToDate.php | 21 ++++++++++++++++----- maintenance/fetchText.php | 5 +++-- maintenance/findHooks.php | 6 +++++- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index dd4ae8dc73..8dad5dc1ff 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -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__ ); } diff --git a/maintenance/backupTextPass.inc b/maintenance/backupTextPass.inc index 27be5fd6e2..11a05904de 100644 --- a/maintenance/backupTextPass.inc +++ b/maintenance/backupTextPass.inc @@ -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 diff --git a/maintenance/checkComposerLockUpToDate.php b/maintenance/checkComposerLockUpToDate.php index 47720710fa..7a85d64ab0 100644 --- a/maintenance/checkComposerLockUpToDate.php +++ b/maintenance/checkComposerLockUpToDate.php @@ -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" ); } diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php index dd4f760f98..983b772515 100644 --- a/maintenance/fetchText.php +++ b/maintenance/fetchText.php @@ -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"; } /** diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index 114366bca6..09254065ef 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -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 ) ) { -- 2.20.1