WMDE-Fisch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334340 )

Change subject: Auto-fix whitespaces and indenting
......................................................................

Auto-fix whitespaces and indenting

Change-Id: I1f2058045ca9884d9f3786fdf3e955b754c4cd49
---
M includes/LineBasedUnifiedDiffFormatter.php
M includes/TwoColConflictHooks.php
M includes/TwoColConflictPage.php
3 files changed, 34 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict 
refs/changes/40/334340/1

diff --git a/includes/LineBasedUnifiedDiffFormatter.php 
b/includes/LineBasedUnifiedDiffFormatter.php
index e0a74e8..6ee4893 100644
--- a/includes/LineBasedUnifiedDiffFormatter.php
+++ b/includes/LineBasedUnifiedDiffFormatter.php
@@ -69,12 +69,12 @@
                                case 'change':
                                        $wordLevelDiff = 
$this->getWordLevelDiff( $edit->getOrig(), $edit->getClosing() );
                                        if ( $wordLevelDiff ) {
-                                               $this->retval[ $this->oldline 
][] = [
+                                               $this->retval[$this->oldline][] 
= [
                                                        'action' => 'delete',
                                                        'old' => 
$this->getOriginalInlineDiff( $wordLevelDiff ),
                                                        'oldline' => 
$this->oldline,
                                                ];
-                                               $this->retval[ $this->oldline 
][] = [
+                                               $this->retval[$this->oldline][] 
= [
                                                        'action' => 'add',
                                                        'new' => 
$this->getClosingInlineDiff( $wordLevelDiff ),
                                                        'newline' => 
$this->newline
@@ -101,7 +101,7 @@
         * @param string[] $lines Lines that should be marked deleted.
         */
        private function deleteLines( array $lines ) {
-               $this->retval[ $this->oldline ][] = [
+               $this->retval[$this->oldline][] = [
                        'action' => 'delete',
                        'old' => "<del{$this->delClass}>" . 
$this->composeLines( $lines ) . '</del>',
                        'oldline' => $this->oldline,
@@ -112,7 +112,7 @@
         * @param string[] $lines Lines that should be marked as added.
         */
        private function addLines( array $lines ) {
-               $this->retval[ $this->oldline ][] = [
+               $this->retval[$this->oldline][] = [
                        'action' => 'add',
                        'new' => "<ins{$this->insClass}>" . 
$this->composeLines( $lines ) . '</ins>',
                        'newline' => $this->newline
@@ -123,7 +123,7 @@
         * @param string[] $lines Lines that should be copied.
         */
        private function copyLines( array $lines ) {
-               $this->retval[ $this->oldline ][] = [
+               $this->retval[$this->oldline][] = [
                        'action' => 'copy',
                        'copy' => $this->composeLines( $lines, false ),
                        'oldline' => $this->oldline,
@@ -138,7 +138,7 @@
         * @param string[] $orig Lines that should be marked deleted.
         * @param string[] $closing Lines that should be marked deleted.
         *
-        *  @return WordLevelDiff|boolean
+        * @return WordLevelDiff|boolean
         */
        private function getWordLevelDiff( array $orig, array $closing ) {
                $diff = new WordLevelDiff( $orig, $closing );
@@ -210,10 +210,10 @@
         */
        private function composeLines( array $lines, $replaceEmptyLine = true ) 
{
                $result = [];
-                       foreach ( $lines as $line ) {
-                               $line = htmlspecialchars( $line );
-                               $result[] = $this->replaceEmptyLine( $line, 
$replaceEmptyLine );
-                       }
+               foreach ( $lines as $line ) {
+                       $line = htmlspecialchars( $line );
+                       $result[] = $this->replaceEmptyLine( $line, 
$replaceEmptyLine );
+               }
                return implode( "\n", $result );
        }
 
diff --git a/includes/TwoColConflictHooks.php b/includes/TwoColConflictHooks.php
index 425b9cd..58a1c5a 100644
--- a/includes/TwoColConflictHooks.php
+++ b/includes/TwoColConflictHooks.php
@@ -9,7 +9,6 @@
  * @ingroup Extensions
  * @license GPL-2.0+
  */
-
 class TwoColConflictHooks {
 
        public static function onCustomEditor( Article $article, User $user ) {
diff --git a/includes/TwoColConflictPage.php b/includes/TwoColConflictPage.php
index 59767f2..c7feb67 100644
--- a/includes/TwoColConflictPage.php
+++ b/includes/TwoColConflictPage.php
@@ -64,8 +64,8 @@
                if ( $this->wikiEditorIsEnabled() ) {
                        $editorClass = ' mw-twocolconflict-wikieditor';
                }
-               $out.= '<div class="mw-twocolconflict-editor-col' . 
$editorClass . '">';
-               $out.= $this->buildConflictPageEditorCol();
+               $out .= '<div class="mw-twocolconflict-editor-col' . 
$editorClass . '">';
+               $out .= $this->buildConflictPageEditorCol();
 
                return $out;
        }
@@ -102,14 +102,14 @@
                );
 
                $out = '<div class="mw-twocolconflict-changes-col">';
-               $out.= '<h3>' . $this->getContext()->msg( 
'twoColConflict-changes-col-title' )->parse() .
+               $out .= '<h3>' . $this->getContext()->msg( 
'twoColConflict-changes-col-title' )->parse() .
                        '</h3>';
-               $out.= '<div class="mw-twocolconflict-col-desc">' . 
$this->getContext()->msg(
-                       'twoColConflict-changes-col-desc', $lastUser, 
$lastChangeTime, $yourChangeTime
+               $out .= '<div class="mw-twocolconflict-col-desc">' . 
$this->getContext()->msg(
+                               'twoColConflict-changes-col-desc', $lastUser, 
$lastChangeTime, $yourChangeTime
                        )->parse() . '</div>';
-               $out.= $this->buildFilterOptionsMenu();
-               $out.= $this->buildChangesTextbox();
-               $out.= '</div>';
+               $out .= $this->buildFilterOptionsMenu();
+               $out .= $this->buildChangesTextbox();
+               $out .= '</div>';
 
                return $out;
        }
@@ -138,11 +138,11 @@
                ] );
 
                $out = '<div class="mw-twocolconflict-filter-options">';
-               $out.= '<div class="mw-twocolconflict-filter-unchanged">' .
+               $out .= '<div class="mw-twocolconflict-filter-unchanged">' .
                        $this->getContext()->msg( 
'twoColConflict-label-unchanged' ) .
                        '</div>';
-               $out.= $showHideOptions;
-               $out.= '</div>';
+               $out .= $showHideOptions;
+               $out .= '</div>';
 
                return $out;
        }
@@ -162,7 +162,7 @@
                        'class' => 'mw-twocolconflict-changes-editor'
                ];
                if ( $this->wikiEditorIsEnabled() ) {
-                       $customAttribs[ 'class' ] .= ' 
mw-twocolconflict-wikieditor';
+                       $customAttribs['class'] .= ' 
mw-twocolconflict-wikieditor';
                }
 
                $attribs = $this->buildTextboxAttribs( $name, $customAttribs, 
$this->context->getUser() );
@@ -183,8 +183,8 @@
                );
 
                $out = '<h3>' . $this->getContext()->msg( 
'twoColConflict-editor-col-title' ) . '</h3>';
-               $out.= '<div class="mw-twocolconflict-col-desc">' . 
$this->getContext()->msg(
-                       'twoColConflict-editor-col-desc', $lastUser, 
$lastChangeTime
+               $out .= '<div class="mw-twocolconflict-col-desc">' . 
$this->getContext()->msg(
+                               'twoColConflict-editor-col-desc', $lastUser, 
$lastChangeTime
                        ) . '</div>';
 
                return $out;
@@ -224,16 +224,16 @@
                $output = [];
                foreach ( $currentLines as $key => $currentLine ) {
                        ++$key;
-                       if ( isset( $combinedChanges[ $key ] ) ) {
-                               foreach ( $combinedChanges[ $key ] as 
$changeSet ) {
-                                       switch ( $changeSet[ 'action' ] ) {
+                       if ( isset( $combinedChanges[$key] ) ) {
+                               foreach ( $combinedChanges[$key] as $changeSet 
) {
+                                       switch ( $changeSet['action'] ) {
                                                case 'add':
                                                        $output[] = '<div 
class="mw-twocolconflict-diffchange-own">' .
                                                                '<div 
class="mw-twocolconflict-diffchange-title">' .
-                                                           '<span 
mw-twocolconflict-diffchange-title-pseudo="' .
+                                                               '<span 
mw-twocolconflict-diffchange-title-pseudo="' .
                                                                
$this->context->msg( 'twoColConflict-diffchange-own-title' )->escaped() .
-                                                           '" 
unselectable="on">' . // used by IE9
-                                                           '</span>' .
+                                                               '" 
unselectable="on">' . // used by IE9
+                                                               '</span>' .
                                                                '</div>' .
                                                                
$changeSet['new'] .
                                                                '</div>';
@@ -241,13 +241,13 @@
                                                case 'delete':
                                                        $output[] = '<div 
class="mw-twocolconflict-diffchange-foreign">' .
                                                                '<div 
class="mw-twocolconflict-diffchange-title">' .
-                                                           '<span 
mw-twocolconflict-diffchange-title-pseudo="' .
+                                                               '<span 
mw-twocolconflict-diffchange-title-pseudo="' .
                                                                
$this->context->msg(
                                                                        
'twoColConflict-diffchange-foreign-title',
                                                                        
$lastUser
                                                                )->escaped() .
-                                                           '" 
unselectable="on">' . // used by IE9
-                                                           '</span>' .
+                                                               '" 
unselectable="on">' . // used by IE9
+                                                               '</span>' .
                                                                '</div>' .
                                                                
$changeSet['old'] .
                                                                '</div>';
@@ -267,7 +267,6 @@
 
        /**
         * Build HTML for the unchanged text in the unified diff box.
-
         * @param string $text HTML
         * @return string HTML
         */
@@ -330,7 +329,7 @@
                        );
 
                } else {
-                       $result =  preg_replace(
+                       $result = preg_replace(
                                '/^[^' . self::WHITESPACES . ']+?[' . 
self::WHITESPACES . ']+?/u',
                                '',
                                mb_substr( $string, -$maxLength ),

-- 
To view, visit https://gerrit.wikimedia.org/r/334340
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f2058045ca9884d9f3786fdf3e955b754c4cd49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to