[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Break long lines

2017-06-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/356899 )

Change subject: Break long lines
..


Break long lines

Prepare to make phpcs pass

Change-Id: Ia76272aa3d80d2e19b9b9890908da93099aa8701
---
M api/ApiQueryLQTThreads.php
M api/ApiThreadAction.php
M classes/Hooks.php
M classes/Thread.php
M classes/ThreadHistoryPager.php
M classes/View.php
M pages/TalkpageView.php
M pages/ThreadActionPage.php
8 files changed, 159 insertions(+), 66 deletions(-)

Approvals:
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, approved



diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php
index 1208ee3..be0614d 100644
--- a/api/ApiQueryLQTThreads.php
+++ b/api/ApiQueryLQTThreads.php
@@ -160,7 +160,9 @@
'thread_id',
'thread_parent',
'replies',
-   function($row) { return array( $row->thread_id 
=> array( 'id' => $row->thread_id ) ); },
+   function ( $row ) {
+   return array( $row->thread_id => array( 
'id' => $row->thread_id ) );
+   },
'reply'
);
}
@@ -168,7 +170,9 @@
$result->addIndexedTagName( array( 'query', 
$this->getModuleName() ), 'thread' );
}
 
-   protected function addSubItems( $tableName, $fields, $joinField, 
$subitemName, /*callable*/ $handleRow, $tagName ) {
+   protected function addSubItems(
+   $tableName, $fields, $joinField, $subitemName, /*callable*/ 
$handleRow, $tagName
+   ) {
$dbr = wfGetDB( DB_SLAVE );
$result = $this->getResult();
 
diff --git a/api/ApiThreadAction.php b/api/ApiThreadAction.php
index 658200f..3f66907 100644
--- a/api/ApiThreadAction.php
+++ b/api/ApiThreadAction.php
@@ -27,14 +27,18 @@
if ( $threadObj instanceof Thread ) {
$threads[] = $threadObj;
 
-   if ( !in_array( $action, 
$actionsAllowedOnNonLqtPage ) && !LqtDispatch::isLqtPage( 
$threadObj->getTitle() ) ) {
+   if ( !in_array( $action, 
$actionsAllowedOnNonLqtPage )
+   && !LqtDispatch::isLqtPage( 
$threadObj->getTitle() )
+   ) {
$articleTitleDBKey = 
$threadObj->getTitle()->getDBkey();
if ( is_callable( [ $this, 
'dieWithError' ] ) ) {
-   $this->dieWithError(
-   [ 
'lqt-not-a-liquidthreads-page', wfEscapeWikiText( $articleTitleDBKey ) ]
-   );
+   $this->dieWithError( [
+   
'lqt-not-a-liquidthreads-page',
+   
wfEscapeWikiText( $articleTitleDBKey )
+   ] );
} else {
-   $message = wfMessage( 
'lqt-not-a-liquidthreads-page', $articleTitleDBKey )->text();
+   $message = wfMessage(
+   
'lqt-not-a-liquidthreads-page', $articleTitleDBKey )->text();
$this->dieUsageMsg( 
$message );
}
}
@@ -85,9 +89,11 @@
);
}
$newMessagesCount = NewMessages::newMessageCount( 
$user, DB_MASTER );
-   $result[count( $result ) - 1]['unreadlink'] = array( // 
Only bother to put this on the last threadaction
+   $msgNewMessages = $newMessagesCount ? 
'lqt-newmessages-n' : 'lqt_newmessages';
+   // Only bother to put this on the last threadaction
+   $result[count( $result ) - 1]['unreadlink'] = array(
'href' => SpecialPage::getTitleFor( 
'NewMessages' )->getLocalURL(),
-   'text' => wfMessage( $newMessagesCount ? 
'lqt-newmessages-n' : 'lqt_newmessages' )->numParams( $newMessagesCount 
)->text(),
+   'text' => wfMessage( $msgNewMessages 
)->numParams( $newMessagesCount )->text(),
'active' => $newMessagesCount > 0,
 

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Break long lines

2017-06-02 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356899 )

Change subject: Break long lines
..

Break long lines

Prepare to make phpcs pass

Change-Id: Ia76272aa3d80d2e19b9b9890908da93099aa8701
---
M api/ApiQueryLQTThreads.php
M api/ApiThreadAction.php
M classes/Hooks.php
M classes/Thread.php
M classes/ThreadHistoryPager.php
M classes/View.php
M pages/TalkpageView.php
M pages/ThreadActionPage.php
8 files changed, 159 insertions(+), 66 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/99/356899/1

diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php
index 1208ee3..be0614d 100644
--- a/api/ApiQueryLQTThreads.php
+++ b/api/ApiQueryLQTThreads.php
@@ -160,7 +160,9 @@
'thread_id',
'thread_parent',
'replies',
-   function($row) { return array( $row->thread_id 
=> array( 'id' => $row->thread_id ) ); },
+   function ( $row ) {
+   return array( $row->thread_id => array( 
'id' => $row->thread_id ) );
+   },
'reply'
);
}
@@ -168,7 +170,9 @@
$result->addIndexedTagName( array( 'query', 
$this->getModuleName() ), 'thread' );
}
 
-   protected function addSubItems( $tableName, $fields, $joinField, 
$subitemName, /*callable*/ $handleRow, $tagName ) {
+   protected function addSubItems(
+   $tableName, $fields, $joinField, $subitemName, /*callable*/ 
$handleRow, $tagName
+   ) {
$dbr = wfGetDB( DB_SLAVE );
$result = $this->getResult();
 
diff --git a/api/ApiThreadAction.php b/api/ApiThreadAction.php
index 658200f..3f66907 100644
--- a/api/ApiThreadAction.php
+++ b/api/ApiThreadAction.php
@@ -27,14 +27,18 @@
if ( $threadObj instanceof Thread ) {
$threads[] = $threadObj;
 
-   if ( !in_array( $action, 
$actionsAllowedOnNonLqtPage ) && !LqtDispatch::isLqtPage( 
$threadObj->getTitle() ) ) {
+   if ( !in_array( $action, 
$actionsAllowedOnNonLqtPage )
+   && !LqtDispatch::isLqtPage( 
$threadObj->getTitle() )
+   ) {
$articleTitleDBKey = 
$threadObj->getTitle()->getDBkey();
if ( is_callable( [ $this, 
'dieWithError' ] ) ) {
-   $this->dieWithError(
-   [ 
'lqt-not-a-liquidthreads-page', wfEscapeWikiText( $articleTitleDBKey ) ]
-   );
+   $this->dieWithError( [
+   
'lqt-not-a-liquidthreads-page',
+   
wfEscapeWikiText( $articleTitleDBKey )
+   ] );
} else {
-   $message = wfMessage( 
'lqt-not-a-liquidthreads-page', $articleTitleDBKey )->text();
+   $message = wfMessage(
+   
'lqt-not-a-liquidthreads-page', $articleTitleDBKey )->text();
$this->dieUsageMsg( 
$message );
}
}
@@ -85,9 +89,11 @@
);
}
$newMessagesCount = NewMessages::newMessageCount( 
$user, DB_MASTER );
-   $result[count( $result ) - 1]['unreadlink'] = array( // 
Only bother to put this on the last threadaction
+   $msgNewMessages = $newMessagesCount ? 
'lqt-newmessages-n' : 'lqt_newmessages';
+   // Only bother to put this on the last threadaction
+   $result[count( $result ) - 1]['unreadlink'] = array(
'href' => SpecialPage::getTitleFor( 
'NewMessages' )->getLocalURL(),
-   'text' => wfMessage( $newMessagesCount ? 
'lqt-newmessages-n' : 'lqt_newmessages' )->numParams( $newMessagesCount 
)->text(),
+   'text' => wfMessage( $msgNewMessages 
)->numParams( $newMessagesCount )->text(),
'active' => $newMessagesCount