Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/358421 )
Change subject: Fix indent of some lines ...................................................................... Fix indent of some lines Changes spaces to tabs or remove tabs or spaces Change-Id: I1a189600561fe244337091f811adf899e2440cab --- M Flow.namespaces.php M FlowActions.php M defines.php M includes/Api/ApiFlowBase.php M includes/Block/Topic.php M includes/Conversion/Utils.php M includes/Import/LiquidThreadsApi/Objects.php M includes/Model/Reference.php M includes/SpamFilter/AbuseFilter.php M maintenance/repair_missing_revision_content.php M maintenance/repair_missing_revision_content_from_parent.php M scripts/pre-commit M tests/phpunit/TalkpageManagerTest.php 13 files changed, 55 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/21/358421/1 diff --git a/Flow.namespaces.php b/Flow.namespaces.php index cf83b49..543babe 100644 --- a/Flow.namespaces.php +++ b/Flow.namespaces.php @@ -105,7 +105,7 @@ /** Italian */ $namespaceNames['it'] = array( - NS_TOPIC => 'Argomento', + NS_TOPIC => 'Argomento', ); /** Korean */ diff --git a/FlowActions.php b/FlowActions.php index fd53bc0..792054d 100644 --- a/FlowActions.php +++ b/FlowActions.php @@ -299,8 +299,8 @@ 'permissions' => array( // no permissions needed for own posts PostRevision::MODERATED_NONE => function( PostRevision $post, RevisionActionPermissions $permissions ) { - return $post->isCreator( $permissions->getUser() ) ? '' : 'flow-edit-post'; - } + return $post->isCreator( $permissions->getUser() ) ? '' : 'flow-edit-post'; + } ), 'root-permissions' => array( PostRevision::MODERATED_NONE => '', @@ -333,8 +333,8 @@ 'permissions' => array( // no permissions needed for own posts PostRevision::MODERATED_NONE => function( PostRevision $post, RevisionActionPermissions $permissions ) { - return $post->isCreator( $permissions->getUser() ) ? '' : 'flow-edit-post'; - } + return $post->isCreator( $permissions->getUser() ) ? '' : 'flow-edit-post'; + } ), 'root-permissions' => array( PostRevision::MODERATED_NONE => '', @@ -621,17 +621,17 @@ return ''; }, 'rc_insert' => function( PostRevision $revision, RecentChangesListener $recentChanges ) { - $post = $revision->getCollection(); - $previousRevision = $post->getPrevRevision( $revision ); - if ( $previousRevision ) { - // * if topic was hidden/deleted, restore can go to RC - // * if topic was suppressed, restore can not go to RC - global $wgFlowActions; - return $wgFlowActions[$previousRevision->getModerationState() . '-topic']['rc_insert']; - } + $post = $revision->getCollection(); + $previousRevision = $post->getPrevRevision( $revision ); + if ( $previousRevision ) { + // * if topic was hidden/deleted, restore can go to RC + // * if topic was suppressed, restore can not go to RC + global $wgFlowActions; + return $wgFlowActions[$previousRevision->getModerationState() . '-topic']['rc_insert']; + } - return true; - }, + return true; + }, 'permissions' => array( PostRevision::MODERATED_LOCKED => array( 'flow-lock', 'flow-delete', 'flow-suppress' ), PostRevision::MODERATED_HIDDEN => array( 'flow-hide', 'flow-delete', 'flow-suppress' ), diff --git a/defines.php b/defines.php index fdcf722..cd30028 100644 --- a/defines.php +++ b/defines.php @@ -3,7 +3,7 @@ // Constants define( 'RC_FLOW', 142 ); // Random number chosen. Can be replaced with rc_source; see bug 72157. if ( !defined( 'NS_TOPIC' ) ) { - define( 'NS_TOPIC', 2600 ); + define( 'NS_TOPIC', 2600 ); } define( 'CONTENT_MODEL_FLOW_BOARD', 'flow-board' ); define( 'FLOW_TALK_PAGE_MANAGER_USER', 'Flow talk page manager' ); diff --git a/includes/Api/ApiFlowBase.php b/includes/Api/ApiFlowBase.php index c9e58f1..02bef8d 100644 --- a/includes/Api/ApiFlowBase.php +++ b/includes/Api/ApiFlowBase.php @@ -73,7 +73,7 @@ */ protected function getLoader() { if ( $this->loader === null ) { - /** @var WorkflowLoaderFactory $factory */ + /** @var WorkflowLoaderFactory $factory */ $factory = Container::get( 'factory.loader.workflow' ); $this->loader = $factory->createWorkflowLoader( $this->page ); } diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php index acb853c..9dd77cb 100644 --- a/includes/Block/Topic.php +++ b/includes/Block/Topic.php @@ -982,7 +982,7 @@ * @param \OutputPage $out * * @todo Provide more informative page title for actions other than view, - * e.g. "Hide post in <TITLE>", "Unlock <TITLE>", etc. + * e.g. "Hide post in <TITLE>", "Unlock <TITLE>", etc. */ public function setPageTitle( \OutputPage $out ) { $topic = $this->loadTopicTitle( $this->action === 'history' ? 'history' : 'view' ); diff --git a/includes/Conversion/Utils.php b/includes/Conversion/Utils.php index 4cb2004..b0c3aba 100644 --- a/includes/Conversion/Utils.php +++ b/includes/Conversion/Utils.php @@ -276,7 +276,9 @@ $params = $vrs['modules']['restbase']; $params['parsoidCompat'] = false; // backward compatibility $class = 'RestbaseVirtualRESTService'; - } else*/if ( isset( $vrs['modules'] ) && isset( $vrs['modules']['parsoid'] ) ) { + } else + */ + if ( isset( $vrs['modules'] ) && isset( $vrs['modules']['parsoid'] ) ) { // there's a global parsoid config, use it next $params = $vrs['modules']['parsoid']; $params['restbaseCompat'] = true; diff --git a/includes/Import/LiquidThreadsApi/Objects.php b/includes/Import/LiquidThreadsApi/Objects.php index 7f92f4c..0e00353 100644 --- a/includes/Import/LiquidThreadsApi/Objects.php +++ b/includes/Import/LiquidThreadsApi/Objects.php @@ -187,7 +187,7 @@ * @param string $signatureUsername Username extracted from signature * @return ScriptedImportRevision Generated top import revision */ - protected function createSignatureClarificationRevision( IObjectRevision $lastRevision, $authorUsername, $signatureUsername ) { + protected function createSignatureClarificationRevision( IObjectRevision $lastRevision, $authorUsername, $signatureUsername ) { $wikitextForLastRevision = $lastRevision->getText(); $newWikitext = $wikitextForLastRevision; diff --git a/includes/Model/Reference.php b/includes/Model/Reference.php index 3886935..bab4e43 100644 --- a/includes/Model/Reference.php +++ b/includes/Model/Reference.php @@ -153,10 +153,10 @@ } public function getUniqueIdentifier() { - return $this->getSrcTitle() . '|' . - $this->getObjectType() . '|' . - $this->getObjectId()->getAlphadecimal() . '|' . - $this->getIdentifier(); + return $this->getSrcTitle() . '|' . + $this->getObjectType() . '|' . + $this->getObjectId()->getAlphadecimal() . '|' . + $this->getIdentifier(); } /** diff --git a/includes/SpamFilter/AbuseFilter.php b/includes/SpamFilter/AbuseFilter.php index b7317f8..509b6ba 100644 --- a/includes/SpamFilter/AbuseFilter.php +++ b/includes/SpamFilter/AbuseFilter.php @@ -116,16 +116,16 @@ * @param mixed &$result Result of the computation */ 'FlowRevisionContent' => function ( \AbuseFilterVariableHolder $vars, $parameters ) { - if ( !isset( $parameters['revision'] ) ) { - return ''; - } - $revision = $parameters['revision']; - if ( $revision instanceof AbstractRevision ) { - return $revision->getContentInWikitext(); - } else { - return ''; - } + if ( !isset( $parameters['revision'] ) ) { + return ''; } + $revision = $parameters['revision']; + if ( $revision instanceof AbstractRevision ) { + return $revision->getContentInWikitext(); + } else { + return ''; + } + } ); } } diff --git a/maintenance/repair_missing_revision_content.php b/maintenance/repair_missing_revision_content.php index 4412fe6..e0ec949 100644 --- a/maintenance/repair_missing_revision_content.php +++ b/maintenance/repair_missing_revision_content.php @@ -269,20 +269,18 @@ echo "Resolved $totalResolvedMultipleMatches multiple matches (" . number_format( 100 * $totalResolvedMultipleMatches / $totalMissingConsidered ) . "%)\n"; function query_revisions( $dbr, $op, $tsEscaped ) { - $direction = $op[0] === '>' ? 'ASC' : 'DESC'; - $sql = - "SELECT revision.rev_timestamp, text.old_text - FROM revision - JOIN text ON revision.rev_text_id = old_id - LEFT JOIN revision parent ON parent.rev_id = revision.rev_parent_id - WHERE revision.rev_timestamp $op $tsEscaped - AND revision.rev_text_id <> parent.rev_text_id - ORDER BY revision.rev_timestamp $direction - LIMIT 10"; + $sql = "SELECT revision.rev_timestamp, text.old_text " . + " FROM revision " . + " JOIN text ON revision.rev_text_id = old_id " . + "LEFT JOIN revision parent ON parent.rev_id = revision.rev_parent_id " . + " WHERE revision.rev_timestamp $op $tsEscaped " . + " AND revision.rev_text_id <> parent.rev_text_id " . + " ORDER BY revision.rev_timestamp $direction " . + " LIMIT 10"; $res = $dbr->query( $sql, __METHOD__ ); -return iterator_to_array( $res ); + return iterator_to_array( $res ); } function parsoid_to_wikitext( $content, $retry = 3 ) { diff --git a/maintenance/repair_missing_revision_content_from_parent.php b/maintenance/repair_missing_revision_content_from_parent.php index 15d1b77..4ed02a2 100644 --- a/maintenance/repair_missing_revision_content_from_parent.php +++ b/maintenance/repair_missing_revision_content_from_parent.php @@ -9,15 +9,15 @@ require_once "$IP/extensions/Flow/FlowActions.php"; $moderationChangeTypes = array( - 'hide-post', - 'hide-topic', - 'delete-post', - 'delete-topic', - 'suppress-post', - 'suppress-topic', - 'lock-topic', - 'restore-post', - 'restore-topic', + 'hide-post', + 'hide-topic', + 'delete-post', + 'delete-topic', + 'suppress-post', + 'suppress-topic', + 'lock-topic', + 'restore-post', + 'restore-topic', ); $csvOutput = fopen( 'repair_results_from_parent_' . wfWikiID() . '.csv', 'w' ); diff --git a/scripts/pre-commit b/scripts/pre-commit index c0df78f..44919fb 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -18,7 +18,7 @@ git diff --cached --name-only | (while read f; do ERROR=0 if grep -n '[[:space:]]$' "$f" ; then - echo "'$f' has trailing whitespace\n" >&2 + echo "'$f' has trailing whitespace\n" >&2 ERROR=1 fi done; exit $ERROR) diff --git a/tests/phpunit/TalkpageManagerTest.php b/tests/phpunit/TalkpageManagerTest.php index 0412a70..ac2b9bc 100644 --- a/tests/phpunit/TalkpageManagerTest.php +++ b/tests/phpunit/TalkpageManagerTest.php @@ -75,7 +75,7 @@ $adminUser = $this->getMockBuilder('User') ->setMethods(array('isAllowed')) - ->getMock(); + ->getMock(); // Set up the expectation for the update() method // to be called only once and with the string 'something' -- To view, visit https://gerrit.wikimedia.org/r/358421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a189600561fe244337091f811adf899e2440cab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits