Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/384233 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: I7c3a189ccd45fd45263a303c98e4bd069ab3bac4 --- M CreatePdfThumbnailsJob.class.php M PdfHandler.image.php M PdfHandler_body.php M phpcs.xml 4 files changed, 45 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PdfHandler refs/changes/33/384233/1 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 @@ /** * 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 @@ } /** - * @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 @@ class PdfImage { /** - * @param $filename + * @param string $filename */ function __construct( $filename ) { $this->mFilename = $filename; @@ -60,8 +60,8 @@ } /** - * @param $data array - * @param $page + * @param array $data + * @param int $page * @return array|bool */ public static function getPageSize( $data, $page ) { @@ -146,7 +146,7 @@ } /** - * @param $dump string + * @param string $dump * @return array|bool */ protected function convertDumpToArray( $dump ) { @@ -198,8 +198,8 @@ * 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 @@ } /** - * @param $file + * @param File $file * @return bool */ function mustRender( $file ) { @@ -53,7 +53,7 @@ } /** - * @param $file + * @param File $file * @return bool */ function isMultiPage( $file ) { @@ -61,8 +61,8 @@ } /** - * @param $name - * @param $value + * @param string $name + * @param string $value * @return bool */ function validateParam( $name, $value ) { @@ -78,7 +78,7 @@ } /** - * @param $params array + * @param array $params * @return bool|string */ function makeParamString( $params ) { @@ -90,7 +90,7 @@ } /** - * @param $str string + * @param string $str * @return array|bool */ function parseParamString( $str ) { @@ -104,7 +104,7 @@ } /** - * @param $params array + * @param array $params * @return array */ function getScriptParams( $params ) { @@ -125,9 +125,9 @@ } /** - * @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 @@ } /** - * @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 @@ } /** - * @param $image File - * @param $path string + * @param File $image + * @param string $path * @return PdfImage */ function getPdfImage( $image, $path ) { @@ -245,7 +245,7 @@ } /** - * @param $image File + * @param File $image * @return bool */ function getMetaArray( $image ) { @@ -277,8 +277,8 @@ } /** - * @param $image File - * @param $path string + * @param File $image + * @param string $path * @return array|bool */ function getImageSize( $image, $path ) { @@ -286,9 +286,9 @@ } /** - * @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 @@ } /** - * @param $image File - * @param $path string + * @param File $image + * @param string $path * @return string */ function getMetadata( $image, $path ) { @@ -312,8 +312,8 @@ } /** - * @param $image File - * @param $metadata string + * @param File $image + * @param string $metadata * @return bool */ function isMetadataValid( $image, $metadata ) { @@ -326,7 +326,7 @@ } /** - * @param $image File + * @param File $image * @param bool|IContextSource $context Context to use (optional) * @return bool|array */ @@ -362,8 +362,8 @@ } /** - * @param $image File - * @param $page int + * @param File $image + * @param int $page * @return array|bool */ function getPageDimensions( File $image, $page ) { @@ -402,8 +402,8 @@ } /** - * @param $image File - * @param $page int + * @param File $image + * @param int $page * @return bool */ function getPageText( File $image, $page ) { @@ -430,7 +430,7 @@ /** * 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 @@ <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> -- To view, visit https://gerrit.wikimedia.org/r/384233 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c3a189ccd45fd45263a303c98e4bd069ab3bac4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PdfHandler Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits