Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/250166
Change subject: Slightly improve type hints
......................................................................
Slightly improve type hints
Change-Id: I620135289b4f0ff95ed3013420194570c26b7a4f
---
M ApiQueryPageImages.php
M PageImages.body.php
2 files changed, 11 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageImages
refs/changes/66/250166/1
diff --git a/ApiQueryPageImages.php b/ApiQueryPageImages.php
index db0b50a..12b8c49 100644
--- a/ApiQueryPageImages.php
+++ b/ApiQueryPageImages.php
@@ -17,7 +17,7 @@
* The latter are included because titles in the File namespace are
* expected to be found with {@see wfFindFile}.
*
- * @return array A map of page ID, which will be negative in the case
+ * @return Title[] A map of page ID, which will be negative in the case
* of missing titles in the File namespace, to Title object
*/
protected function getTitles() {
@@ -124,11 +124,11 @@
* For a given page, set API return values for thumbnail and pageimage
as needed
*
* @param array $prop The prop values from the API request
- * @param integer $pageId The ID of the page
+ * @param int $pageId The ID of the page
* @param string $fileName The name of the file to transform
- * @param integer $size The thumbsize value from the API request
+ * @param int $size The thumbsize value from the API request
*/
- protected function setResultValues( $prop, $pageId, $fileName, $size ) {
+ protected function setResultValues( array $prop, $pageId, $fileName,
$size ) {
$vals = array();
if ( isset( $prop['thumbnail'] ) || isset( $prop['original'] )
) {
$file = wfFindFile( $fileName );
diff --git a/PageImages.body.php b/PageImages.body.php
index cfe7f19..4e16f52 100644
--- a/PageImages.body.php
+++ b/PageImages.body.php
@@ -221,7 +221,7 @@
* @param array[] &$results
* @return bool
*/
- public static function onApiOpenSearchSuggest( &$results ) {
+ public static function onApiOpenSearchSuggest( array &$results ) {
global $wgPageImagesExpandOpenSearchXml;
if ( !$wgPageImagesExpandOpenSearchXml || !count( $results ) ) {
@@ -247,10 +247,10 @@
* @param IContextSource $context
* @param array[] $watchlist
* @param array[] &$images
- * @return true
+ * @return bool Always true
*/
- public static function onSpecialMobileEditWatchlist_images(
IContextSource $context, $watchlist,
- &$images
+ public static function onSpecialMobileEditWatchlist_images(
IContextSource $context, array $watchlist,
+ array &$images
) {
$ids = array();
foreach ( $watchlist as $ns => $pages ) {
@@ -312,8 +312,8 @@
* Returns score for image, the more the better, if it is less than
zero,
* the image shouldn't be used for anything
*
- * @param array $image: Associative array describing an image
- * @param int $position: Image order on page
+ * @param array $image Associative array describing an image
+ * @param int $position Image order on page
* @return int
*/
private static function getScore( array $image, $position ) {
@@ -346,7 +346,7 @@
* Returns width/height ratio of an image as displayed or 0 is not
available
*
* @param array $image
- * @return float
+ * @return float|int
*/
private static function getRatio( array $image ) {
$width = $image['fullwidth'];
--
To view, visit https://gerrit.wikimedia.org/r/250166
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I620135289b4f0ff95ed3013420194570c26b7a4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageImages
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits