Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/305019
Change subject: Fix some method calls and phpcs
......................................................................
Fix some method calls and phpcs
Change-Id: I936085bc172f648367be0e155517afd084d70147
---
M Collection.body.php
M Collection.i18n.php
M Collection.session.php
M Collection.templates.php
M RenderingAPI.php
5 files changed, 16 insertions(+), 14 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection
refs/changes/19/305019/1
diff --git a/Collection.body.php b/Collection.body.php
index 77ec9da..558903c 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -65,7 +65,7 @@
}
$out->redirect( wfAppendQuery(
SkinTemplate::makeSpecialUrl( 'Book' ),
- $request->appendQueryArray( array( 'bookcmd' =>
rtrim( $par, '/' ) ), true )
+ $request->appendQueryArray( array( 'bookcmd' =>
rtrim( $par, '/' ) ) )
) );
return;
}
@@ -1038,7 +1038,7 @@
$writer = $request->getVal( 'writer' );
$return_to = $request->getVal( 'return_to', '' );
- $result = CollectionRenderingAPI::instance( $writer
)->getRenderStatus( $collectionId, $writer );
+ $result = CollectionRenderingAPI::instance( $writer
)->getRenderStatus( $collectionId );
if ( !$this->handleResult( $result ) ) {
return; // FIXME?
}
@@ -1120,7 +1120,7 @@
$api = CollectionRenderingAPI::instance( $writer );
$this->tempfile = tmpfile();
- $r = $api->getRenderStatus( $collectionId, $writer );
+ $r = $api->getRenderStatus( $collectionId );
$info = false;
$url = $r->get( 'url' );
@@ -1134,7 +1134,7 @@
$content_length = $r->get( 'content_length' );
$content_disposition = $r->get( 'content_disposition' );
} else {
- $info = $api->download( $collectionId, $writer );
+ $info = $api->download( $collectionId );
$content_type = $info->get( 'content_type' );
$content_length = $info->get( 'download_content_length'
);
$content_disposition = null;
diff --git a/Collection.i18n.php b/Collection.i18n.php
index b1679be..b42c413 100644
--- a/Collection.i18n.php
+++ b/Collection.i18n.php
@@ -15,7 +15,7 @@
function wfJsonI18nShim6fd5b0d541bf7ce6( $cache, $code, &$cachedData ) {
$codeSequence = array_merge( array( $code ),
$cachedData['fallbackSequence'] );
foreach ( $codeSequence as $csCode ) {
- $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
+ $fileName = __DIR__ . "/i18n/$csCode.json";
if ( is_readable( $fileName ) ) {
$data = FormatJson::decode( file_get_contents(
$fileName ), true );
foreach ( array_keys( $data ) as $key ) {
diff --git a/Collection.session.php b/Collection.session.php
index 1a7bee8..a497b77 100644
--- a/Collection.session.php
+++ b/Collection.session.php
@@ -155,7 +155,7 @@
foreach ( $coll['items'] as $item ) {
if ( $item['type'] == 'article' ) {
$t = Title::newFromText( $item['title']
);
- if ( $t && !$lc->isBadLink(
$t->getPrefixedDbKey() ) ) {
+ if ( $t && !$lc->isBadLink(
$t->getPrefixedDBkey() ) ) {
$newitems[] = $item;
}
} else {
diff --git a/Collection.templates.php b/Collection.templates.php
index f69cec3..6397c20 100644
--- a/Collection.templates.php
+++ b/Collection.templates.php
@@ -101,10 +101,12 @@
$partnerClasses = "";
$about_partner = wfMessage( 'coll-about_pp', $partnerData['name']
)->escaped();
if ( isset( $partnerData['infopagetitle'] ) ) {
- $infopage = Title::newFromText( wfMessage(
$partnerData['infopagetitle'] )->inContentLanguage()->text() );
+ $infopage = Title::newFromText(
+ wfMessage( $partnerData['infopagetitle']
+ )->inContentLanguage()->text() );
if ( $infopage && $infopage->exists() ) {
$partnerClasses = " coll-more_info collapsed";
- }
+ }
}
?>
<li class="collection-partner<?php echo $partnerClasses ?>">
diff --git a/RenderingAPI.php b/RenderingAPI.php
index edefd62..2fee498 100644
--- a/RenderingAPI.php
+++ b/RenderingAPI.php
@@ -31,7 +31,7 @@
* @param array $params
* @return CollectionAPIResult
*/
- protected abstract function makeRequest( $command, array $params );
+ abstract protected function makeRequest( $command, array $params );
/**
* @return String expanded $wgScriptPath to work around T39868
@@ -100,17 +100,17 @@
}
/**
- * Returns inromation about a collection's rendering status
+ * Returns information about a collection's rendering status
*
* @param $collectionId
* @return CollectionAPIResult
*/
public function getRenderStatus( $collectionId ) {
- return $this->makeRequest( 'render_status',
+ return $this->makeRequest(
+ 'render_status',
array(
'collection_id' => $collectionId,
- ),
- 'CollectionStatusAPIResult'
+ )
);
}
@@ -344,7 +344,7 @@
public function get( $key /*, ... */ ) {
$args = func_get_args();
$val = $this->response;
- foreach( $args as $arg ) {
+ foreach ( $args as $arg ) {
if ( !isset( $val[$arg] ) ) {
return '';
}
--
To view, visit https://gerrit.wikimedia.org/r/305019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I936085bc172f648367be0e155517afd084d70147
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits