media: Add missing false return types to doc
Change-Id: Ieefa5bbfddb803ceb41196725c1f344f175c10c3
This commit is contained in:
parent
42d554c930
commit
0bd6c0f180
6 changed files with 18 additions and 18 deletions
|
|
@ -301,7 +301,7 @@ class BitmapMetadataHandler {
|
|||
* Little Endian or Big Endian. Needed for exif stuff.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return string 'BE' or 'LE' or false
|
||||
* @return string|false 'BE' or 'LE' or false
|
||||
*/
|
||||
public static function getTiffByteOrder( $filename ) {
|
||||
$fh = fopen( $filename, 'rb' );
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class DjVuHandler extends ImageHandler {
|
|||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return bool|string
|
||||
* @return string|false
|
||||
*/
|
||||
public function makeParamString( $params ) {
|
||||
$page = $params['page'] ?? 1;
|
||||
|
|
@ -114,7 +114,7 @@ class DjVuHandler extends ImageHandler {
|
|||
|
||||
/**
|
||||
* @param string $str
|
||||
* @return array|bool
|
||||
* @return array|false
|
||||
*/
|
||||
public function parseParamString( $str ) {
|
||||
$m = false;
|
||||
|
|
@ -252,7 +252,7 @@ class DjVuHandler extends ImageHandler {
|
|||
* Get metadata, unserializing it if necessary.
|
||||
*
|
||||
* @param File $file The DjVu file in question
|
||||
* @return string XML metadata as a string.
|
||||
* @return string|false XML metadata as a string.
|
||||
* @throws MWException
|
||||
*/
|
||||
private function getXMLMetadata( File $file ) {
|
||||
|
|
@ -276,7 +276,7 @@ class DjVuHandler extends ImageHandler {
|
|||
* Cache a document tree for the DjVu XML metadata
|
||||
* @param File $image
|
||||
* @param bool $gettext DOCUMENT (Default: false)
|
||||
* @return bool|SimpleXMLElement
|
||||
* @return SimpleXMLElement|false
|
||||
*/
|
||||
public function getMetaTree( $image, $gettext = false ) {
|
||||
if ( $gettext && $image->getHandlerState( self::STATE_TEXT_TREE ) ) {
|
||||
|
|
@ -403,8 +403,8 @@ class DjVuHandler extends ImageHandler {
|
|||
|
||||
/**
|
||||
* Given an XML metadata tree, returns dimension information about the document
|
||||
* @param bool|SimpleXMLElement $metatree The file's XML metadata tree
|
||||
* @return bool|array
|
||||
* @param SimpleXMLElement|false $metatree The file's XML metadata tree
|
||||
* @return array|false
|
||||
*/
|
||||
protected function getDimensionInfoFromMetaTree( $metatree ) {
|
||||
if ( !$metatree ) {
|
||||
|
|
@ -431,7 +431,7 @@ class DjVuHandler extends ImageHandler {
|
|||
/**
|
||||
* @param File $image
|
||||
* @param int $page Page number to get information for
|
||||
* @return bool|string Page text or false when no text found.
|
||||
* @return string|false Page text or false when no text found.
|
||||
*/
|
||||
public function getPageText( File $image, $page ) {
|
||||
$tree = $this->getMetaTree( $image, true );
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class DjVuImage {
|
|||
|
||||
/**
|
||||
* Return an XML string describing the DjVu image
|
||||
* @return string|bool
|
||||
* @return string|null|false
|
||||
*/
|
||||
public function retrieveMetaData() {
|
||||
global $wgDjvuDump, $wgDjvuTxt;
|
||||
|
|
@ -309,7 +309,7 @@ EOR;
|
|||
/**
|
||||
* Hack to temporarily work around djvutoxml bug
|
||||
* @param string $dump
|
||||
* @return string
|
||||
* @return string|false
|
||||
*/
|
||||
private function convertDumpToXML( $dump ) {
|
||||
if ( strval( $dump ) == '' ) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class GIFHandler extends BitmapHandler {
|
|||
* @todo Add unit tests
|
||||
*
|
||||
* @param File $image
|
||||
* @return bool
|
||||
* @return int
|
||||
*/
|
||||
public function getImageArea( $image ) {
|
||||
$metadata = $image->getMetadataArray();
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ abstract class MediaHandler {
|
|||
*
|
||||
* @note This method is currently unused.
|
||||
* @param File $image
|
||||
* @return string
|
||||
* @return string|false
|
||||
*/
|
||||
public function getMetadataType( $image ) {
|
||||
return false;
|
||||
|
|
@ -423,7 +423,7 @@ abstract class MediaHandler {
|
|||
* @param File $image
|
||||
* @param string $script
|
||||
* @param array $params
|
||||
* @return bool|ThumbnailImage
|
||||
* @return ThumbnailImage|false
|
||||
*/
|
||||
public function getScriptedTransform( $image, $script, $params ) {
|
||||
return false;
|
||||
|
|
@ -613,7 +613,7 @@ abstract class MediaHandler {
|
|||
*
|
||||
* @param File $image
|
||||
* @param int $page Page number to get information for
|
||||
* @return bool|string Page text or false when no text found or if
|
||||
* @return string|false Page text or false when no text found or if
|
||||
* unsupported.
|
||||
*/
|
||||
public function getPageText( File $image, $page ) {
|
||||
|
|
@ -623,7 +623,7 @@ abstract class MediaHandler {
|
|||
/**
|
||||
* Get the text of the entire document.
|
||||
* @param File $file
|
||||
* @return bool|string The text of the document or false if unsupported.
|
||||
* @return string|false The text of the document or false if unsupported.
|
||||
*/
|
||||
public function getEntireText( File $file ) {
|
||||
$numPages = $file->pageCount();
|
||||
|
|
@ -739,7 +739,7 @@ abstract class MediaHandler {
|
|||
*
|
||||
* @param string $key The metadata field key
|
||||
* @param string|array $vals The unformatted value of this metadata field
|
||||
* @param bool|IContextSource $context Context to use (optional)
|
||||
* @param IContextSource|false $context Context to use (optional)
|
||||
* @return false|null|string|array False to use default formatting, null
|
||||
* to remove this tag from the formatted list; otherwise return
|
||||
* a formatted HTML string (or array of them).
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ class SvgHandler extends ImageHandler {
|
|||
* @param string $dstPath
|
||||
* @param string $width
|
||||
* @param string $height
|
||||
* @param bool|string $lang Language code of the language to render the SVG in
|
||||
* @param string|false $lang Language code of the language to render the SVG in
|
||||
* @throws MWException
|
||||
* @return bool|MediaTransformError
|
||||
*/
|
||||
|
|
@ -529,7 +529,7 @@ class SvgHandler extends ImageHandler {
|
|||
|
||||
/**
|
||||
* @param array $params Name=>value pairs of parameters
|
||||
* @return string Filename to use
|
||||
* @return string|false Filename to use
|
||||
*/
|
||||
public function makeParamString( $params ) {
|
||||
$lang = '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue