Improve some parameter docs

Change-Id: I7c3a189ccd45fd45263a303c98e4bd069ab3bac4
This commit is contained in:
Umherirrender 2017-10-14 15:47:04 +02:00
parent ae13bd98c2
commit cdc0307367
4 changed files with 45 additions and 49 deletions

View file

@ -10,8 +10,8 @@ class CreatePdfThumbnailsJob extends Job {
/**
* Construct a thumbnail job
*
* @param $title Title Title object
* @param $params array Associative array of options:
* @param Title $title Title object
* @param array $params Associative array of options:
* page: page number for which the thumbnail will be created
* jobtype: CreatePDFThumbnailsJob::BIG_THUMB or CreatePDFThumbnailsJob::SMALL_THUMB
* BIG_THUMB will create a thumbnail visible for full thumbnail view,
@ -87,9 +87,9 @@ class CreatePdfThumbnailsJob extends Job {
}
/**
* @param $upload UploadBase
* @param $mime
* @param $error
* @param UploadBase $upload
* @param string $mime
* @param string &$error
* @return bool
*/
public static function insertJobs( $upload, $mime, &$error ) {

View file

@ -30,7 +30,7 @@ use UtfNormal\Validator;
class PdfImage {
/**
* @param $filename
* @param string $filename
*/
function __construct( $filename ) {
$this->mFilename = $filename;
@ -60,8 +60,8 @@ class PdfImage {
}
/**
* @param $data array
* @param $page
* @param array $data
* @param int $page
* @return array|bool
*/
public static function getPageSize( $data, $page ) {
@ -146,7 +146,7 @@ class PdfImage {
}
/**
* @param $dump string
* @param string $dump
* @return array|bool
*/
protected function convertDumpToArray( $dump ) {
@ -198,8 +198,8 @@ class PdfImage {
* This is used to generate the metadata table at the bottom
* of the image description page.
*
* @param $data Array metadata
* @return Array post-processed metadata
* @param array $data metadata
* @return array post-processed metadata
*/
protected function postProcessDump( array $data ) {
$meta = new BitmapMetadataHandler();

View file

@ -45,7 +45,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $file
* @param File $file
* @return bool
*/
function mustRender( $file ) {
@ -53,7 +53,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $file
* @param File $file
* @return bool
*/
function isMultiPage( $file ) {
@ -61,8 +61,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $name
* @param $value
* @param string $name
* @param string $value
* @return bool
*/
function validateParam( $name, $value ) {
@ -78,7 +78,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $params array
* @param array $params
* @return bool|string
*/
function makeParamString( $params ) {
@ -90,7 +90,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $str string
* @param string $str
* @return array|bool
*/
function parseParamString( $str ) {
@ -104,7 +104,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $params array
* @param array $params
* @return array
*/
function getScriptParams( $params ) {
@ -125,9 +125,9 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $width
* @param $height
* @param $msg
* @param int $width
* @param int $height
* @param string $msg
* @return MediaTransformError
*/
protected function doThumbError( $width, $height, $msg ) {
@ -136,11 +136,11 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $dstPath string
* @param $dstUrl string
* @param $params array
* @param $flags int
* @param File $image
* @param string $dstPath
* @param string $dstUrl
* @param array $params
* @param int $flags
* @return MediaTransformError|MediaTransformOutput|ThumbnailImage|TransformParameterError
*/
function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
@ -228,8 +228,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $path string
* @param File $image
* @param string $path
* @return PdfImage
*/
function getPdfImage( $image, $path ) {
@ -245,7 +245,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param File $image
* @return bool
*/
function getMetaArray( $image ) {
@ -277,8 +277,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $path string
* @param File $image
* @param string $path
* @return array|bool
*/
function getImageSize( $image, $path ) {
@ -286,9 +286,9 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $ext
* @param $mime string
* @param $params null
* @param string $ext
* @param string $mime
* @param null $params
* @return array
*/
function getThumbType( $ext, $mime, $params = null ) {
@ -303,8 +303,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $path string
* @param File $image
* @param string $path
* @return string
*/
function getMetadata( $image, $path ) {
@ -312,8 +312,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $metadata string
* @param File $image
* @param string $metadata
* @return bool
*/
function isMetadataValid( $image, $metadata ) {
@ -326,7 +326,7 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param File $image
* @param bool|IContextSource $context Context to use (optional)
* @return bool|array
*/
@ -362,8 +362,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $page int
* @param File $image
* @param int $page
* @return array|bool
*/
function getPageDimensions( File $image, $page ) {
@ -402,8 +402,8 @@ class PdfHandler extends ImageHandler {
}
/**
* @param $image File
* @param $page int
* @param File $image
* @param int $page
* @return bool
*/
function getPageText( File $image, $page ) {
@ -430,7 +430,7 @@ class PdfHandler extends ImageHandler {
/**
* Register a module with the warning messages in it.
* @param &$resourceLoader ResourceLoader
* @param ResourceLoader &$resourceLoader
*/
static function registerWarningModule( &$resourceLoader ) {
$resourceLoader->register( 'pdfhandler.messages', [

View file

@ -2,15 +2,11 @@
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule>
<file>.</file>
<arg name="extensions" value="php,php5,inc" />
<arg name="encoding" value="utf8" />
<exclude-pattern>vendor</exclude-pattern>
<exclude-pattern>node_modules</exclude-pattern>
<arg name="encoding" value="UTF-8" />
</ruleset>