Slightly improve type hints

Change-Id: I620135289b4f0ff95ed3013420194570c26b7a4f
This commit is contained in:
Marius Hoch 2015-10-31 02:30:18 +01:00
parent d55ef9d7e2
commit 4d81dbac99
2 changed files with 11 additions and 11 deletions

View file

@ -17,7 +17,7 @@ class ApiQueryPageImages extends ApiQueryBase {
* 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 @@ class ApiQueryPageImages extends ApiQueryBase {
* 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 );

View file

@ -221,7 +221,7 @@ class PageImages {
* @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 @@ class PageImages {
* @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 @@ class PageImages {
* 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 @@ class PageImages {
* 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'];