jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380325 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: Ie75e6f6c05217f8da32c70522d23275b70d95cee --- M ApiQueryVideoInfo.php M ApiTranscodeReset.php M ApiTranscodeStatus.php M SpecialOrphanedTimedText.php M SpecialTimedMediaHandler.php M TimedMediaHandler.hooks.php M TimedMediaHandler_body.php M TimedMediaIframeOutput.php M TimedMediaThumbnail.php M TimedMediaTransformOutput.php M TimedTextPage.php M TranscodeStatusTable.php M WebVideoTranscode/WebVideoTranscode.php M WebVideoTranscode/WebVideoTranscodeJob.php M handlers/FLACHandler/FLACHandler.php M handlers/ID3Handler/ID3Handler.php M handlers/Mp3Handler/Mp3Handler.php M handlers/Mp4Handler/Mp4Handler.php M handlers/OggHandler/OggHandler.php M handlers/TextHandler/TextHandler.php M handlers/WAVHandler/WAVHandler.php M handlers/WebMHandler/WebMHandler.php M phpcs.xml M tests/phpunit/TestOggHandler.php M tests/phpunit/TestTimedMediaHandler.php M tests/phpunit/TestTimedMediaTransformOutput.php M tests/phpunit/TestWebMHandler.php 27 files changed, 265 insertions(+), 244 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/ApiQueryVideoInfo.php b/ApiQueryVideoInfo.php index 72a17b3..0acf987 100644 --- a/ApiQueryVideoInfo.php +++ b/ApiQueryVideoInfo.php @@ -58,6 +58,7 @@ /** * @see ApiBase::getExamplesMessages() + * @return array */ protected function getExamplesMessages() { return [ diff --git a/ApiTranscodeReset.php b/ApiTranscodeReset.php index 9a0e05b..7fa1037 100644 --- a/ApiTranscodeReset.php +++ b/ApiTranscodeReset.php @@ -110,8 +110,8 @@ } /** - * @param $file - * @param $transcodeKey + * @param File $file + * @param string|bool $transcodeKey * @return int|string */ public static function checkTimeSinceLastRest( $file, $transcodeKey ) { @@ -137,7 +137,7 @@ } /** - * @param $state + * @param array $state * @return int|string */ public static function getStateResetTime( $state ) { @@ -218,6 +218,7 @@ /** * @see ApiBase::getExamplesMessages() + * @return array */ protected function getExamplesMessages() { // @codingStandardsIgnoreStart diff --git a/ApiTranscodeStatus.php b/ApiTranscodeStatus.php index 59a352a..88052ee 100644 --- a/ApiTranscodeStatus.php +++ b/ApiTranscodeStatus.php @@ -66,6 +66,7 @@ /** * @see ApiBase::getExamplesMessages() + * @return array */ protected function getExamplesMessages() { return [ diff --git a/SpecialOrphanedTimedText.php b/SpecialOrphanedTimedText.php index d651a74..00153f4 100644 --- a/SpecialOrphanedTimedText.php +++ b/SpecialOrphanedTimedText.php @@ -23,6 +23,7 @@ /** * This is alphabetical, so sort ascending. + * @return bool */ public function sortDescending() { return false; @@ -33,6 +34,7 @@ * * This query is actually almost cheap given the current * number of things in TimedText namespace. + * @return bool */ public function isExpensive() { return true; @@ -41,7 +43,7 @@ /** * Main execution function * - * @param $par String subpage + * @param string $par subpage */ public function execute( $par ) { global $wgEnableLocalTimedText; @@ -165,6 +167,7 @@ * * Given a title like "TimedText:Some bit here.webm.en.srt" * check to see if "File:Some bit here.webm" really exists (locally). + * @param Title $title * @return bool True if we should cross out the line. */ protected function existenceCheck( Title $title ) { @@ -205,8 +208,8 @@ /** * Preprocess result to do existence checks all at once. * - * @param $db Database - * @param $res ResultWraper + * @param Database $db + * @param ResultWraper $res */ public function preprocessResults( $db, $res ) { parent::preprocessResults( $db, $res ); diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php index 99a3b67..22a2fb3 100644 --- a/SpecialTimedMediaHandler.php +++ b/SpecialTimedMediaHandler.php @@ -69,8 +69,8 @@ /** * @param OutputPage $out - * @param $state - * @param $states + * @param string $state + * @param array $states * @param bool $showTable */ private function renderState( $out, $state, $states, $showTable = true ) { diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 7c8cfbc..175c5e1 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -13,7 +13,7 @@ * These are configurable due to Commons history: T123823 * These need to be before registerhooks due to: T123695 * - * @param array $list + * @param array &$list * @return bool */ public static function addCanonicalNamespaces( array &$list ) { @@ -37,7 +37,7 @@ * But for now we register them dynamically, because they are config dependent, * while we have two players * - * @param ResourceLoader $resourceLoader + * @param ResourceLoader &$resourceLoader * @return bool */ public static function resourceLoaderRegisterModules( &$resourceLoader ) { @@ -391,8 +391,8 @@ } /** - * @param ImagePage $imagePage the imagepage that is being rendered - * @param OutputPage $out the output for this imagepage + * @param ImagePage &$imagePage the imagepage that is being rendered + * @param OutputPage &$out the output for this imagepage * @return bool */ public static function onImageOpenShowImageInlineBefore( &$imagePage, &$out ) { @@ -438,8 +438,8 @@ } /** - * @param $title Title - * @param $article Article + * @param Title &$title + * @param Article &$article * @return bool */ public static function checkForTimedTextPage( &$title, &$article ) { @@ -451,8 +451,8 @@ } /** - * @param $diffEngine DifferenceEngine - * @param $output OutputPage + * @param DifferenceEngine $diffEngine + * @param OutputPage $output * @return bool */ public static function checkForTimedTextDiff( $diffEngine, $output ) { @@ -466,8 +466,8 @@ } /** - * @param SkinTemplate $sktemplate - * @param array $links + * @param SkinTemplate &$sktemplate + * @param array &$links */ public static function onSkinTemplateNavigation( SkinTemplate &$sktemplate, array &$links ) { if ( self::isTimedMediaHandlerTitle( $sktemplate->getTitle() ) ) { @@ -482,7 +482,7 @@ /** * Wraps the isTranscodableFile function - * @param $title Title + * @param Title $title * @return bool */ public static function isTranscodableTitle( $title ) { @@ -495,7 +495,7 @@ /** * Utility function to check if a given file can be "transcoded" - * @param $file File object + * @param File &$file File object * @return bool */ public static function isTranscodableFile( & $file ) { @@ -534,7 +534,7 @@ } /** - * @param $title Title + * @param Title $title * @return bool */ public static function isTimedMediaHandlerTitle( $title ) { @@ -554,8 +554,8 @@ } /** - * @param $article Article - * @param $html string + * @param Article $article + * @param string &$html * @return bool */ public static function checkForTranscodeStatus( $article, &$html ) { @@ -568,7 +568,9 @@ } /** - * @param $file LocalFile object + * @param File $file LocalFile object + * @param bool $reupload + * @param bool $hasNewPageContent * @return bool */ public static function onFileUpload( $file, $reupload, $hasNewPageContent ) { @@ -587,9 +589,9 @@ * For now we just remove all the derivatives for the oldTitle. In the future we could * look at moving the files, but right now thumbs are not moved, so I don't want to be * inconsistent. - * @param $title Title - * @param $newTitle Title - * @param $user User + * @param Title $title + * @param Title $newTitle + * @param User $user * @return bool */ public static function checkTitleMove( $title, $newTitle, $user ) { @@ -605,11 +607,11 @@ /** * Hook to FileDeleteComplete * remove transcodes on delete - * @param $file File - * @param $oldimage - * @param $article Article - * @param $user User - * @param $reason string + * @param File $file + * @param File|bool $oldimage + * @param Article $article + * @param User $user + * @param string $reason * @return bool */ public static function onFileDeleteComplete( $file, $oldimage, $article, $user, $reason ) { @@ -624,7 +626,10 @@ /** * If file gets reverted to a previous version, reset transcodes. * - * @param $article Article + * @param Article $article + * @param Revision $rev + * @param int $baseID + * @param User $user * @return bool */ public static function onNewRevisionFromEditComplete( @@ -648,7 +653,7 @@ * link, make sure we've got the updated set of transcodes. This'll allow a user or * automated process to see their status and reset them. * - * @param $article Article + * @param Article $article * @return bool */ public static function onArticlePurge( $article ) { @@ -663,7 +668,7 @@ /** * Hook to add list of PHPUnit test cases. - * @param $files array of files + * @param array &$files array of files * @return bool */ public static function registerUnitTests( array &$files ) { @@ -696,6 +701,7 @@ /** * Hook to reset player serial so that parser tests are not order-dependent + * @param array &$globals */ public static function onParserTestGlobals( &$globals ) { TimedMediaTransformOutput::resetSerialForTest(); @@ -708,8 +714,8 @@ * FIXME: There ought to be a better interface for determining whether the * page is liable to contain timed media. * - * @param $out OutputPage - * @param $sk + * @param OutputPage &$out + * @param Skin &$sk * @return bool */ static function pageOutputHook( &$out, &$sk ) { @@ -782,9 +788,9 @@ /** * Return false here to evict existing parseroutput cache - * @param $parserOutput ParserOutput - * @param $wikiPage WikiPage - * @param $parserOptions + * @param ParserOutput $parserOutput + * @param WikiPage $wikiPage + * @param ParserOutput $parserOptions * @return bool */ public static function rejectParserCacheValue( $parserOutput, $wikiPage, $parserOptions ) { @@ -804,9 +810,9 @@ } /** - * @param $hash + * @param string &$hash * @param User $user - * @param $forOptions + * @param array &$forOptions * @return bool */ public static function changePageRenderingHash( &$hash, User $user, &$forOptions ) { @@ -819,8 +825,8 @@ } /** - * @param $user - * @param $prefs + * @param User $user + * @param array &$prefs * @return bool */ public static function onGetBetaFeaturePreferences( $user, &$prefs ) { diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php index 318b927..9362a4d 100644 --- a/TimedMediaHandler_body.php +++ b/TimedMediaHandler_body.php @@ -12,9 +12,9 @@ /** * Get an image size array like that returned by getimagesize(), or false if it * can't be determined. - * @param $file File - * @param $path string - * @param $metadata bool + * @param File $file + * @param string $path + * @param bool $metadata * @return array|bool */ function getImageSize( $file, $path, $metadata = false ) { @@ -39,8 +39,8 @@ /** * Validate a embed file parameters * - * @param $name {String} Name of the param - * @param $value {Mixed} Value to validated + * @param string $name Name of the param + * @param mixed $value Value to validated * @return bool */ function validateParam( $name, $value ) { @@ -63,7 +63,7 @@ /** * TODO we should really have "$file" available here to validate the param string - * @param $params array + * @param array $params * @return string */ function makeParamString( $params ) { @@ -97,7 +97,7 @@ /** * Used by thumb.php to find url parameters * - * @param $str string + * @param string $str * @return array|bool Array of thumbnail parameters, or false if string cannot be parsed */ function parseParamString( $str ) { @@ -125,8 +125,8 @@ } /** - * @param $image File - * @param $params array + * @param File $image + * @param array &$params * @return bool */ function normaliseParams( $image, &$params ) { @@ -193,8 +193,8 @@ * * The core embedPlayer module lazy loaded by the loader modules * - * @param $parser Parser - * @param $file File + * @param Parser $parser + * @param File $file */ function parserTransformHook( $parser, $file ) { $parserOutput = $parser->getOutput(); @@ -219,8 +219,8 @@ /** * Utility functions - * @param $timeString - * @param $length + * @param string $timeString + * @param bool|int $length * @return bool|int */ public static function parseTimeString( $timeString, $length = false ) { @@ -250,7 +250,7 @@ /** * @static - * @param $timePassed + * @param int $timePassed * @return string|array As from Message::listParam if available, otherwise * a corresponding string in the language from $wgLang. */ @@ -289,7 +289,7 @@ * consist of hh:mm:ss.ms * also see: http://www.ietf.org/rfc/rfc2326.txt section 3.6 * - * @param $time Number Seconds to be converted to npt time format + * @param number $time Seconds to be converted to npt time format * @return bool|string */ public static function seconds2npt( $time ) { @@ -311,7 +311,7 @@ } /** - * @param $metadata + * @param string $metadata * @return bool|mixed */ function unpackMetadata( $metadata ) { @@ -326,8 +326,8 @@ } /** - * @param $image - * @param $metadata + * @param File $image + * @param string $metadata * @return bool */ function isMetadataValid( $image, $metadata ) { @@ -335,8 +335,8 @@ } /** - * @param $ext - * @param $mime + * @param string $ext + * @param string $mime * @param null $params * @return array */ @@ -346,7 +346,7 @@ /** * checks if a given file is an audio file - * @param $file File + * @param File $file * @return bool */ function isAudio( $file ) { @@ -354,11 +354,11 @@ } /** - * @param $file File - * @param $dstPath String - * @param $dstUrl String - * @param $params array - * @param $flags int + * @param File $file + * @param string $dstPath + * @param string $dstUrl + * @param array $params + * @param int $flags * @return bool|MediaTransformError|MediaTransformOutput|TimedMediaTransformOutput */ function doTransform( $file, $dstPath, $dstUrl, $params, $flags = 0 ) { @@ -428,7 +428,7 @@ } /** - * @param $file + * @param File $file * @return bool */ function canRender( $file ) { @@ -436,7 +436,7 @@ } /** - * @param $file + * @param File $file * @return bool */ function mustRender( $file ) { @@ -445,7 +445,7 @@ /** * Get a stream offset time - * @param $file + * @param File $file * @return int */ function getOffset( $file ) { @@ -454,7 +454,7 @@ /** * Get length of a file - * @param $file + * @param File $file * @return int */ function getLength( $file ) { @@ -462,7 +462,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getDimensionsString( $file ) { diff --git a/TimedMediaIframeOutput.php b/TimedMediaIframeOutput.php index 9888a63..5aac391 100644 --- a/TimedMediaIframeOutput.php +++ b/TimedMediaIframeOutput.php @@ -12,8 +12,8 @@ class TimedMediaIframeOutput { /** * The iframe hook check file pages embedplayer=yes - * @param $title Title - * @param $article Article + * @param Title &$title + * @param Article &$article * @param bool $doOutput * @return bool */ @@ -41,7 +41,8 @@ /** * Output an iframe - * @param $title Title + * @param Title $title + * @return bool * @throws Exception */ static function outputIframe( $title ) { diff --git a/TimedMediaThumbnail.php b/TimedMediaThumbnail.php index 7a00c18..69de373 100644 --- a/TimedMediaThumbnail.php +++ b/TimedMediaThumbnail.php @@ -2,7 +2,7 @@ class TimedMediaThumbnail { /** - * @param $options array() + * @param array $options * @return bool|MediaTransformError */ static function get( $options ) { @@ -30,7 +30,7 @@ * Run oggThumb to generate a still image from a video file, using a frame * close to the given number of seconds from the start. * - * @param $options array + * @param array $options * @return bool|MediaTransformError * */ @@ -82,7 +82,7 @@ } /** - * @param $options array + * @param array $options * @return bool|MediaTransformError */ static function tryFfmpegThumb( $options ) { @@ -158,7 +158,7 @@ } /** - * @param $options array + * @param array $options * @return bool|MediaTransformError */ static function resizeThumb( $options ) { @@ -218,7 +218,7 @@ } /** - * @param $options array + * @param array $options * @return bool|float|int */ static function getThumbTime( $options ) { diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php index 055e520..a2cc73c 100644 --- a/TimedMediaTransformOutput.php +++ b/TimedMediaTransformOutput.php @@ -45,6 +45,7 @@ /** * Get the media transform thumbnail + * @param bool|array $sizeOverride * @return string */ function getUrl( $sizeOverride = false ) { @@ -119,7 +120,7 @@ } /** - * @param $options array + * @param array $options * @return string * @throws Exception */ @@ -166,8 +167,8 @@ /** * XXX migrate this to the mediawiki Html class as 'tagSet' helper function - * @param $tagName - * @param $tagSet + * @param string $tagName + * @param array $tagSet * @return string */ static function htmlTagSet( $tagName, $tagSet ) { @@ -225,6 +226,7 @@ /** * Get target popup player size + * @return int */ function getPopupPlayerSize() { // Get the max width from the enabled transcode settings: @@ -293,8 +295,8 @@ * This function is also called by the Score extension, in which case * there is no connection to a file object. * - * @param $sizeOverride array - * @param $autoPlay boolean sets the autoplay attribute + * @param array $sizeOverride + * @param bool $autoPlay sets the autoplay attribute * @return string */ function getHtmlMediaTagOutput( $sizeOverride = [], $autoPlay = false ) { @@ -375,7 +377,7 @@ /** * Get poster. - * @param $width Integer width of poster. Should not equal $this->width. + * @param int $width width of poster. Should not equal $this->width. * @throws Exception If $width is same as $this->width. * @return String|bool url for poster or false */ @@ -395,7 +397,8 @@ /** * Get the media attributes - * @param $sizeOverride Array|bool of width and height + * @param array|bool $sizeOverride Array of width and height + * @param bool $autoPlay * @return array */ function getMediaAttr( $sizeOverride = false, $autoPlay = false ) { diff --git a/TimedTextPage.php b/TimedTextPage.php index 3a08523..b35a10e 100644 --- a/TimedTextPage.php +++ b/TimedTextPage.php @@ -28,7 +28,7 @@ /** * Render TimedText to given output - * @param $out OutputPage + * @param OutputPage $out */ public function renderOutput( $out ) { // parse page title: @@ -112,7 +112,7 @@ /** * Timed text or file is hosted on remote repo, Add a short description and link to foring repo - * @param $file File the base file + * @param File $file the base file */ function doLinkToRemote( $file ) { $output = $this->getContext()->getOutput(); @@ -151,7 +151,7 @@ /** * Gets the video HTML ( with the current language set as default ) - * @param $videoTitle string + * @param string $videoTitle * @return String */ private function getVideoHTML( $videoTitle ) { @@ -172,7 +172,7 @@ /** * Gets an HTML representation of the Timed Text * - * @param $languageName string + * @param string $languageName * @return Message|string */ private function getTimedTextHTML( $languageName ) { diff --git a/TranscodeStatusTable.php b/TranscodeStatusTable.php index b14571a..5f6d8ab 100644 --- a/TranscodeStatusTable.php +++ b/TranscodeStatusTable.php @@ -8,7 +8,7 @@ */ class TranscodeStatusTable { /** - * @param $file File + * @param File $file * @return string */ public static function getHTML( $file ) { @@ -34,6 +34,8 @@ /** * Get the video or audio codec for the defined transcode, * for grouping/sorting purposes. + * @param string $key + * @return string */ public static function codecFromTranscodeKey( $key ) { if ( isset( WebVideoTranscode::$derivativeSettings[$key] ) ) { @@ -54,7 +56,7 @@ } /** - * @param $file File + * @param File $file * @return string */ public static function getTranscodesTable( $file ) { @@ -139,8 +141,8 @@ } /** - * @param $file File - * @param $transcodeKey string + * @param File $file + * @param string $transcodeKey * @return string */ public static function getSourceUrl( $file, $transcodeKey ) { @@ -148,8 +150,8 @@ } /** - * @param $file File - * @param $state + * @param File $file + * @param array $state * @return string */ public static function getTranscodeDuration( $file, $state ) { @@ -166,8 +168,8 @@ } /** - * @param $file File - * @param $state + * @param File $file + * @param array $state * @return string */ public static function getTranscodeBitrate( $file, $state ) { @@ -180,8 +182,8 @@ } /** - * @param $file File - * @param $state + * @param File $file + * @param array $state * @return string */ public static function getStatusMsg( $file, $state ) { diff --git a/WebVideoTranscode/WebVideoTranscode.php b/WebVideoTranscode/WebVideoTranscode.php index c484a09..b444c08 100644 --- a/WebVideoTranscode/WebVideoTranscode.php +++ b/WebVideoTranscode/WebVideoTranscode.php @@ -522,8 +522,8 @@ ]; /** - * @param $file File - * @param $transcodeKey string + * @param File $file + * @param string $transcodeKey * @return string */ public static function getDerivativeFilePath( $file, $transcodeKey ) { @@ -556,8 +556,8 @@ /** * Get url for a transcode. * - * @param $file File - * @param $suffix string Transcode key + * @param File $file + * @param string $suffix Transcode key * @return string */ public static function getTranscodedUrlForFile( $file, $suffix = '' ) { @@ -567,8 +567,8 @@ /** * Get temp file at target path for video encode * - * @param $file File - * @param $transcodeKey String + * @param File &$file + * @param string $transcodeKey * * @return TempFSFile at target encode path */ @@ -605,8 +605,8 @@ /** * Give a rough estimate on file size * Note this is not always accurate.. especially with variable bitrate codecs ;) - * @param $file File - * @param $transcodeKey string + * @param File $file + * @param string $transcodeKey * @return number */ public static function getProjectedFileSize( $file, $transcodeKey ) { @@ -626,8 +626,8 @@ /** * Static function to get the set of video assets * Checks if the file is local or remote and grabs respective sources - * @param $file File - * @param $options array + * @param File &$file + * @param array $options * @return array|mixed */ public static function getSources( &$file , $options = [] ) { @@ -645,8 +645,8 @@ * <https://gerrit.wikimedia.org/r/#/c/117916/> * * Because this works with commons regardless of whether TimedMediaHandler is installed or not - * @param $file File - * @param $options array + * @param File &$file + * @param array $options * @return array|mixed */ public static function getRemoteSources( &$file, $options = [] ) { @@ -710,8 +710,8 @@ * * This will not automatically update or queue anything! * - * @param $file File object - * @param $options array Options, a set of options: + * @param File &$file File object + * @param array $options Options, a set of options: * 'nodata' Strips the data- attribute, useful when your output is not html * @return array an associative array of sources suitable for <source> tag output */ @@ -752,8 +752,8 @@ /** * Get the transcode state for a given filename and transcodeKey * - * @param $fileName string - * @param $transcodeKey string + * @param string $file + * @param string $transcodeKey * @return bool */ public static function isTranscodeReady( $file, $transcodeKey ) { @@ -784,7 +784,8 @@ * Populates the transcode table with the current DB state of transcodes * if transcodes are not found in the database their state is set to "false" * - * @param {Object} File object + * @param File $file File object + * @param IDatabase|bool $db */ public static function getTranscodeState( $file, $db = false ) { global $wgTranscodeBackgroundTimeLimit; @@ -846,8 +847,8 @@ * startJobQueue() or updateJobQueue(). * * also remove the transcode files: - * @param $file File Object - * @param $transcodeKey String Optional transcode key to remove only this key + * @param File &$file File Object + * @param string|bool $transcodeKey Optional transcode key to remove only this key */ public static function removeTranscodes( &$file, $transcodeKey = false ) { // if transcode key is non-false, non-null: @@ -901,7 +902,7 @@ } /** - * @param $titleObj Title + * @param Title &$titleObj */ public static function invalidatePagesWithFile( &$titleObj ) { wfDebug( "WebVideoTranscode:: Invalidate pages that include: " . $titleObj->getDBkey() . "\n" ); @@ -940,8 +941,8 @@ /** * Get the primary "source" asset used for other derivatives - * @param $file File - * @param $options array + * @param File $file + * @param array $options * @return array */ public static function getPrimarySourceAttributes( $file, $options = [] ) { @@ -994,9 +995,9 @@ /** * Get derivative "source" attributes - * @param $file File - * @param $transcodeKey string - * @param $options array + * @param File $file + * @param string $transcodeKey + * @param array $options * @return array */ public static function getDerivativeSourceAttributes( $file, $transcodeKey, $options = [] ) { @@ -1046,7 +1047,7 @@ /** * Queue up all enabled transcodes if missing. - * @param $file File object + * @param File $file File object */ public static function startJobQueue( File $file ) { global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet; @@ -1067,7 +1068,7 @@ * Make sure all relevant transcodes for the given file are tracked in the * transcodes table; add entries for any missing ones. * - * @param $file File object + * @param File $file File object */ public static function cleanupTranscodes( File $file ) { global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet; @@ -1108,8 +1109,8 @@ /** * Check if the given transcode key is appropriate for the file. * - * @param $file File object - * @param $transcodeKey String transcode key + * @param File $file File object + * @param string $transcodeKey transcode key * @return bool */ public static function isTranscodeEnabled( File $file, $transcodeKey ) { @@ -1143,8 +1144,8 @@ /** * Update the job queue if the file is not already in the job queue: - * @param $file File object - * @param $transcodeKey String transcode key + * @param File &$file File object + * @param string $transcodeKey transcode key */ public static function updateJobQueue( &$file, $transcodeKey ) { $fileName = $file->getTitle()->getDbKey(); @@ -1210,8 +1211,8 @@ /** * Check if this transcode belongs to the high-priority queue. - * @param $file File - * @param $transcodeKey string + * @param File $file + * @param string $transcodeKey * @return bool */ public static function isTranscodePrioritized( File $file, $transcodeKey ) { @@ -1228,8 +1229,8 @@ /** * Return job queue length for the queue that will run this transcode. - * @param $file File - * @param $transcodeKey string + * @param File $file + * @param string $transcodeKey * @return int */ public static function getQueueSize( File $file, $transcodeKey ) { @@ -1249,8 +1250,8 @@ /** * Transforms the size per a given "maxSize" * if maxSize is > file, file size is used - * @param $file File - * @param $targetMaxSize int + * @param File &$file + * @param int $targetMaxSize * @return array */ public static function getMaxSizeTransform( &$file, $targetMaxSize ) { @@ -1285,8 +1286,8 @@ /** * Test if a given transcode target is larger than the source file * - * @param $file File object - * @param $targetMaxSize string + * @param File &$file File object + * @param string $targetMaxSize * @return bool */ public static function isTargetLargerThanFile( &$file, $targetMaxSize ) { @@ -1331,7 +1332,7 @@ /** * Return maxSize array for given maxSize setting * - * @param $targetMaxSize string + * @param string $targetMaxSize * @return array */ public static function getMaxSize( $targetMaxSize ) { diff --git a/WebVideoTranscode/WebVideoTranscodeJob.php b/WebVideoTranscode/WebVideoTranscodeJob.php index 4bec851..cec23b2 100644 --- a/WebVideoTranscode/WebVideoTranscodeJob.php +++ b/WebVideoTranscode/WebVideoTranscodeJob.php @@ -37,7 +37,7 @@ /** * Local function to debug output ( jobs don't have access to the maintenance output class ) - * @param $msg string + * @param string $msg */ private function output( $msg ) { print $msg . "\n"; @@ -93,8 +93,8 @@ /** * Update the transcode table with failure time and error - * @param $transcodeKey string - * @param $error string + * @param string $transcodeKey + * @param string $error * */ private function setTranscodeError( $transcodeKey, $error ) { @@ -356,8 +356,8 @@ /** * Utility helper for ffmpeg and ffmpeg2theora mapping - * @param $options array - * @param $pass int + * @param array $options + * @param int $pass * @return bool|string */ function ffmpegEncode( $options, $pass=0 ) { @@ -433,8 +433,8 @@ /** * Adds ffmpeg shell options for h264 * - * @param $options - * @param $pass + * @param array $options + * @param int $pass * @return string */ function ffmpegAddH264VideoOptions( $options, $pass ) { @@ -511,8 +511,8 @@ /** * Adds ffmpeg shell options for webm * - * @param $options - * @param $pass + * @param array $options + * @param int $pass * @return string */ function ffmpegAddWebmVideoOptions( $options, $pass ) { @@ -584,8 +584,8 @@ * Used only when $wgFFmpeg2theoraLocation set to false. * Warning: does not create Ogg skeleton metadata track. * - * @param $options - * @param $pass + * @param array $options + * @param int $pass * @return string */ function ffmpegAddTheoraVideoOptions( $options, $pass ) { @@ -631,8 +631,8 @@ } /** - * @param $options array - * @param $pass + * @param array $options + * @param int $pass * @return string */ function ffmpegAddAudioOptions( $options, $pass ) { @@ -675,7 +675,7 @@ /** * ffmpeg2Theora mapping is much simpler since it is the basis of the the firefogg API - * @param $options array + * @param array $options * @return bool|string */ function ffmpeg2TheoraEncode( $options ) { @@ -739,8 +739,8 @@ * if $wgEnableBackgroundTranscodeJobs is enabled will mannage a background transcode task * else it just directly passes off to wfShellExec * - * @param $cmd String Command to be run - * @param $retval String, refrence variable to return the exit code + * @param string $cmd Command to be run + * @param string &$retval reference variable to return the exit code * @return string */ public function runShellExec( $cmd, &$retval ) { @@ -801,10 +801,10 @@ } /** - * @param $cmd - * @param $retval - * @param $encodingLog - * @param $retvalLog + * @param string $cmd + * @param string &$retval + * @param string $encodingLog + * @param string $retvalLog * @param string $caller The calling method */ public function runChildCmd( $cmd, &$retval, $encodingLog, $retvalLog, $caller ) { @@ -841,10 +841,10 @@ } /** - * @param $pid - * @param $retval - * @param $encodingLog - * @param $retvalLog + * @param int $pid + * @param string &$retval + * @param string $encodingLog + * @param string $retvalLog * @return string */ public function monitorTranscode( $pid, &$retval, $encodingLog, $retvalLog ) { @@ -937,7 +937,7 @@ /** * check if proccess is running and not a zombie - * @param $pid int + * @param int $pid * @return bool */ public static function isProcessRunningKillZombie( $pid ) { @@ -956,7 +956,7 @@ /** * Kill Application PID * - * @param $pid int + * @param int $pid * @return bool */ public static function killProcess( $pid ) { diff --git a/handlers/FLACHandler/FLACHandler.php b/handlers/FLACHandler/FLACHandler.php index 95cf059..fce1e00 100644 --- a/handlers/FLACHandler/FLACHandler.php +++ b/handlers/FLACHandler/FLACHandler.php @@ -5,7 +5,7 @@ class FLACHandler extends ID3Handler { /** - * @param $file File + * @param File $file * @return string */ function getMetadataType( $file ) { @@ -13,7 +13,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getWebType( $file ) { @@ -21,7 +21,7 @@ } /** - * @param $file File + * @param File $file * @return array|bool */ function getStreamTypes( $file ) { @@ -40,7 +40,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getShortDesc( $file ) { @@ -55,7 +55,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getLongDesc( $file ) { diff --git a/handlers/ID3Handler/ID3Handler.php b/handlers/ID3Handler/ID3Handler.php index f7789dd..7e3242d 100644 --- a/handlers/ID3Handler/ID3Handler.php +++ b/handlers/ID3Handler/ID3Handler.php @@ -7,7 +7,7 @@ const METADATA_VERSION = 2; /** - * @param $path string + * @param string $path * @return array */ protected function getID3( $path ) { @@ -43,8 +43,8 @@ } /** - * @param $file File - * @param $path string + * @param File $file + * @param string $path * @return string */ function getMetadata( $file, $path ) { @@ -53,7 +53,7 @@ } /** - * @param $metadata + * @param string $metadata * @return bool|mixed */ function unpackMetadata( $metadata ) { @@ -68,7 +68,7 @@ } /** - * @param $file File + * @param File $file * @return mixed */ function getBitrate( $file ) { @@ -81,7 +81,7 @@ } /** - * @param $file File + * @param File $file * @return int */ function getLength( $file ) { @@ -94,7 +94,7 @@ } /** - * @param $file File + * @param File $file * @return bool|int */ function getFramerate( $file ) { diff --git a/handlers/Mp3Handler/Mp3Handler.php b/handlers/Mp3Handler/Mp3Handler.php index 7cde667..69e4016 100644 --- a/handlers/Mp3Handler/Mp3Handler.php +++ b/handlers/Mp3Handler/Mp3Handler.php @@ -5,20 +5,21 @@ class Mp3Handler extends ID3Handler { /** - * @param $image + * @param File $image * @return string */ function getMetadataType( $image ) { return 'mp3'; } /** - * @param $file File + * @param File $file + * @return string */ function getWebType( $file ) { return 'audio/mpeg'; } /** - * @param $file File + * @param File $file * @return array|bool */ function getStreamTypes( $file ) { @@ -34,7 +35,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getShortDesc( $file ) { @@ -49,7 +50,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getLongDesc( $file ) { diff --git a/handlers/Mp4Handler/Mp4Handler.php b/handlers/Mp4Handler/Mp4Handler.php index 03d6001..76e6c65 100644 --- a/handlers/Mp4Handler/Mp4Handler.php +++ b/handlers/Mp4Handler/Mp4Handler.php @@ -5,7 +5,7 @@ class Mp4Handler extends ID3Handler { /** - * @param $path string + * @param string $path * @return array */ protected function getID3( $path ) { @@ -17,9 +17,9 @@ /** * Get the "media size" - * @param $file File - * @param $path string - * @param $metadata bool + * @param File $file + * @param string $path + * @param bool $metadata * @return array|bool */ function getImageSize( $file, $path, $metadata = false ) { @@ -44,14 +44,15 @@ } /** - * @param $image + * @param File $image * @return string */ function getMetadataType( $image ) { return 'mp4'; } /** - * @param $file File + * @param File $file + * @return string */ function getWebType( $file ) { // @codingStandardsIgnoreStart @@ -74,7 +75,7 @@ return 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"'; } /** - * @param $file File + * @param File $file * @return array|bool */ function getStreamTypes( $file ) { @@ -102,7 +103,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getShortDesc( $file ) { @@ -117,7 +118,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getLongDesc( $file ) { diff --git a/handlers/OggHandler/OggHandler.php b/handlers/OggHandler/OggHandler.php index 2690220..583c415 100644 --- a/handlers/OggHandler/OggHandler.php +++ b/handlers/OggHandler/OggHandler.php @@ -6,8 +6,8 @@ const METADATA_VERSION = 2; /** - * @param $image File - * @param $path string + * @param File $image + * @param string $path * @return string */ function getMetadata( $image, $path ) { @@ -142,9 +142,9 @@ /** * Get the "media size" * - * @param $file File - * @param $path string - * @param $metadata bool|string|array + * @param File $file + * @param string $path + * @param bool|string|array $metadata * @return array|bool */ function getImageSize( $file, $path, $metadata = false ) { @@ -197,14 +197,15 @@ } /** - * @param $image + * @param File $image * @return string */ function getMetadataType( $image ) { return 'ogg'; } /** - * @param $file File + * @param File $file + * @return string */ function getWebType( $file ) { $baseType = ( $file->getWidth() == 0 && $file->getHeight() == 0 ) ? 'audio' : 'video'; @@ -217,7 +218,7 @@ return $baseType . '; codecs="' . $codecs . '"'; } /** - * @param $file File + * @param File $file * @return array|bool */ function getStreamTypes( $file ) { @@ -233,7 +234,7 @@ } /** - * @param $file File + * @param File $file * @return int */ function getOffset( $file ) { @@ -246,7 +247,7 @@ } /** - * @param $file File + * @param File $file * @return int */ function getLength( $file ) { @@ -260,7 +261,7 @@ /** * Get useful response headers for GET/HEAD requests for a file with the given metadata - * @param $metadata Array Contains this handler's unserialized getMetadata() for a file + * @param array $metadata Contains this handler's unserialized getMetadata() for a file * @return Array * @since 1.30 */ @@ -277,7 +278,7 @@ } /** - * @param $file File + * @param File $file * @return float|int */ function getFramerate( $file ) { @@ -296,7 +297,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getShortDesc( $file ) { @@ -319,7 +320,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getLongDesc( $file ) { @@ -369,7 +370,7 @@ } /** - * @param $file File + * @param File $file * @return float|int */ function getBitRate( $file ) { diff --git a/handlers/TextHandler/TextHandler.php b/handlers/TextHandler/TextHandler.php index 3ad1e09..57bd26e 100644 --- a/handlers/TextHandler/TextHandler.php +++ b/handlers/TextHandler/TextHandler.php @@ -325,6 +325,7 @@ * Only use for local and foreignDb requests * * @param Title|ForeignTitle $pageTitle + * @param string $contentType * @return string */ function getFullURL( $pageTitle, $contentType ) { diff --git a/handlers/WAVHandler/WAVHandler.php b/handlers/WAVHandler/WAVHandler.php index b21fd85..bba6063 100644 --- a/handlers/WAVHandler/WAVHandler.php +++ b/handlers/WAVHandler/WAVHandler.php @@ -5,7 +5,7 @@ class WAVHandler extends ID3Handler { /** - * @param $file File + * @param File $file * @return string */ function getMetadataType( $file ) { @@ -13,7 +13,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getWebType( $file ) { @@ -35,7 +35,7 @@ return Status::newFatal( 'timedmedia-wav-pcm-required' ); } /** - * @param $file File + * @param File $file * @return array|bool */ function getStreamTypes( $file ) { @@ -54,7 +54,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getShortDesc( $file ) { @@ -69,7 +69,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getLongDesc( $file ) { diff --git a/handlers/WebMHandler/WebMHandler.php b/handlers/WebMHandler/WebMHandler.php index 708a46a..d3b09b0 100644 --- a/handlers/WebMHandler/WebMHandler.php +++ b/handlers/WebMHandler/WebMHandler.php @@ -5,7 +5,7 @@ class WebMHandler extends ID3Handler { /** - * @param $path string + * @param string $path * @return array */ protected function getID3( $path ) { @@ -17,9 +17,9 @@ /** * Get the "media size" - * @param $file File - * @param $path string - * @param $metadata bool|string|array + * @param File $file + * @param string $path + * @param bool|string|array $metadata * @return array|bool */ function getImageSize( $file, $path, $metadata = false ) { @@ -79,7 +79,7 @@ } /** - * @param $file + * @param File $file * @return string */ function getMetadataType( $file ) { @@ -87,7 +87,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getWebType( $file ) { @@ -104,7 +104,7 @@ } /** - * @param $file File + * @param File $file * @return array|bool */ function getStreamTypes( $file ) { @@ -139,7 +139,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getShortDesc( $file ) { @@ -154,7 +154,7 @@ } /** - * @param $file File + * @param File $file * @return String */ function getLongDesc( $file ) { diff --git a/phpcs.xml b/phpcs.xml index 66a4c57..2c013e5 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,17 +4,15 @@ <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> - <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" /> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/> </rule> <rule ref="Generic.Files.LineLength"> - <exclude-pattern>TimedMediaHandler.i18n.*.php</exclude-pattern> + <exclude-pattern>TimedMediaHandler\.i18n\.*\.php</exclude-pattern> </rule> <file>.</file> <arg name="extensions" value="php,php5,inc"/> diff --git a/tests/phpunit/TestOggHandler.php b/tests/phpunit/TestOggHandler.php index bdcf6e7..f1b26aa 100644 --- a/tests/phpunit/TestOggHandler.php +++ b/tests/phpunit/TestOggHandler.php @@ -16,8 +16,8 @@ /** * @dataProvider providerGetCommonMetaArray - * @param $filename String name of file - * @param $expected Array + * @param string $filename name of file + * @param array $expected */ function testGetCommonMetaArray( $filename, $expected ) { $testFile = $this->dataFile( $filename, 'application/ogg' ); @@ -47,8 +47,8 @@ /** * @dataProvider providerGetWebType - * @param $filename String name of file - * @param $expected String Mime type (including codecs) + * @param string $filename name of file + * @param string $expected Mime type (including codecs) */ function testGetWebType( $filename, $expected ) { $testFile = $this->dataFile( $filename, 'application/ogg' ); diff --git a/tests/phpunit/TestTimedMediaHandler.php b/tests/phpunit/TestTimedMediaHandler.php index d81eeb6..fa13042 100644 --- a/tests/phpunit/TestTimedMediaHandler.php +++ b/tests/phpunit/TestTimedMediaHandler.php @@ -12,8 +12,8 @@ /** * @dataProvider providerParseParamString - * @param $str String a thumbnail parameter string - * @param $expected Array Expected thumbnailing parameters + * @param string $str a thumbnail parameter string + * @param array $expected Expected thumbnailing parameters */ function testParseParamString( $str, $expected ) { $result = $this->handler->parseParamString( $str ); diff --git a/tests/phpunit/TestTimedMediaTransformOutput.php b/tests/phpunit/TestTimedMediaTransformOutput.php index 88a9e6e..f209fed 100644 --- a/tests/phpunit/TestTimedMediaTransformOutput.php +++ b/tests/phpunit/TestTimedMediaTransformOutput.php @@ -22,9 +22,9 @@ } /** - * @param $width int The requested width of the thumbnail - * @param $minVideoSize int The min width a non-pop up video is acceptable - * @param $expectPopup boolean Do we expect a pop up video + * @param int $width The requested width of the thumbnail + * @param int $minVideoSize The min width a non-pop up video is acceptable + * @param bool $expectPopup Do we expect a pop up video * * @dataProvider providerIsPopUp */ @@ -54,9 +54,9 @@ } /** - * @param $thumbWidth int Requested width - * @param $sources array - * @param $sortedSources array + * @param int $thumbWidth Requested width + * @param array $sources + * @param array $sortedSources * @dataProvider providerSortMediaByBandwidth */ function testSortMediaByBandwidth( $thumbWidth, $sources, $sortedSources ) { diff --git a/tests/phpunit/TestWebMHandler.php b/tests/phpunit/TestWebMHandler.php index 855ce04..8824d52 100644 --- a/tests/phpunit/TestWebMHandler.php +++ b/tests/phpunit/TestWebMHandler.php @@ -16,8 +16,8 @@ /** * @dataProvider providerGetStreamTypes - * @param $filename String name of file - * @param $expected array List of codecs in file + * @param string $filename name of file + * @param array $expected List of codecs in file */ function testGetStreamTypes( $filename, $expected ) { $testFile = $this->dataFile( $filename, 'video/webm' ); @@ -34,8 +34,8 @@ /** * @dataProvider providerGetWebType - * @param $filename String name of file - * @param $expected String Mime type + * @param string $filename name of file + * @param string $expected Mime type */ function testGetWebType( $filename, $expected ) { $testFile = $this->dataFile( $filename, 'video/webm' ); -- To view, visit https://gerrit.wikimedia.org/r/380325 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie75e6f6c05217f8da32c70522d23275b70d95cee Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits