/**
* @param $title
- * @param $repo ForeignApiRepo
+ * @param ForeignApiRepo $repo
* @param $info
* @param bool $exists
*/
}
/**
- * @param $title Title
- * @param $repo ForeignApiRepo
+ * @param Title $title
+ * @param ForeignApiRepo $repo
* @return ForeignAPIFile|null
*/
static function newFromTitle( Title $title, $repo ) {
} else {
$img = new self( $title, $repo, $info, true );
}
+
return $img;
} else {
return null;
);
if ( $thumbUrl === false ) {
global $wgLang;
+
return $this->repo->getThumbError(
$this->getName(),
$width,
$wgLang->getCode()
);
}
+
return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );
}
// Info we can get from API...
/**
- * @param $page int
+ * @param int $page
* @return int|number
*/
public function getWidth( $page = 1 ) {
}
/**
- * @param $page int
+ * @param int $page
* @return int
*/
public function getHeight( $page = 1 ) {
if ( isset( $this->mInfo['metadata'] ) ) {
return serialize( self::parseMetadata( $this->mInfo['metadata'] ) );
}
+
return null;
}
/**
- * @return array|null extended metadata (see imageinfo API for format) or null on error
+ * @return array|null Extended metadata (see imageinfo API for format) or
+ * null on error
*/
public function getExtendedMetadata() {
if ( isset( $this->mInfo['extmetadata'] ) ) {
return $this->mInfo['extmetadata'];
}
+
return null;
}
/**
- * @param $metadata array
+ * @param array $metadata
* @return array
*/
public static function parseMetadata( $metadata ) {
foreach ( $metadata as $meta ) {
$ret[$meta['name']] = self::parseMetadata( $meta['value'] );
}
+
return $ret;
}
}
/**
+ * @param int $audience
+ * @param User $user
* @return null|string
*/
public function getDescription( $audience = self::FOR_PUBLIC, User $user = null ) {
}
/**
- * @return bool|Mixed|string
+ * @return bool|string
*/
function getTimestamp() {
return wfTimestamp( TS_MW,
$magic = MimeMagic::singleton();
$this->mInfo['mime'] = $magic->guessTypesForExtension( $this->getExtension() );
}
+
return $this->mInfo['mime'];
}
return $this->mInfo['mediatype'];
}
$magic = MimeMagic::singleton();
+
return $magic->getMediaType( null, $this->getMimeType() );
}
/**
* Only useful if we're locally caching thumbs anyway...
- * @param $suffix string
+ * @param string $suffix
* @return null|string
*/
function getThumbPath( $suffix = '' ) {
if ( $suffix ) {
$path = $path . $suffix . '/';
}
+
return $path;
} else {
return null;
}
/**
- * @param $options array
+ * @param array $options
*/
function purgeThumbnails( $options = array() ) {
global $wgMemc;