From cdc03073676d2d013a56a55ef0205742eb4bfc22 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 14 Oct 2017 15:47:04 +0200 Subject: [PATCH] Improve some parameter docs Change-Id: I7c3a189ccd45fd45263a303c98e4bd069ab3bac4 --- CreatePdfThumbnailsJob.class.php | 10 ++--- PdfHandler.image.php | 12 +++--- PdfHandler_body.php | 66 ++++++++++++++++---------------- phpcs.xml | 6 +-- 4 files changed, 45 insertions(+), 49 deletions(-) diff --git a/CreatePdfThumbnailsJob.class.php b/CreatePdfThumbnailsJob.class.php index 1dfacef..6e9d3c1 100644 --- a/CreatePdfThumbnailsJob.class.php +++ b/CreatePdfThumbnailsJob.class.php @@ -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 ) { diff --git a/PdfHandler.image.php b/PdfHandler.image.php index 8346b31..c413570 100644 --- a/PdfHandler.image.php +++ b/PdfHandler.image.php @@ -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(); diff --git a/PdfHandler_body.php b/PdfHandler_body.php index 0ff5aad..01da498 100644 --- a/PdfHandler_body.php +++ b/PdfHandler_body.php @@ -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', [ diff --git a/phpcs.xml b/phpcs.xml index 97a989b..f9a438f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,15 +2,11 @@ - - . - - vendor - node_modules +