jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371408 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.11.0
......................................................................


build: Updating mediawiki/mediawiki-codesniffer to 0.11.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle

The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment

Change-Id: I39f584dceb8564e60148064855179fe8a6bc3be8
---
M ApiTranscodeStatus.php
M SpecialTimedMediaHandler.php
M TimedMediaHandler.hooks.php
M TimedMediaHandler.i18n.magic.php
M TimedMediaHandler_body.php
M TimedMediaThumbnail.php
M TimedMediaTransformOutput.php
M TimedTextPage.php
M TranscodeStatusTable.php
M WebVideoTranscode/WebVideoTranscode.php
M WebVideoTranscode/WebVideoTranscodeJob.php
M composer.json
M handlers/FLACHandler/FLACHandler.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
20 files changed, 92 insertions(+), 85 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiTranscodeStatus.php b/ApiTranscodeStatus.php
index a2e4d45..59a352a 100644
--- a/ApiTranscodeStatus.php
+++ b/ApiTranscodeStatus.php
@@ -25,7 +25,7 @@
                                if ( 
TimedMediaHandlerHooks::isTranscodableTitle( $img->getTitle() ) ) {
                                        $transcodeStatus = 
WebVideoTranscode::getTranscodeState( $img );
                                        // remove useless properties
-                                       foreach ( $transcodeStatus as 
$key=>&$val ) {
+                                       foreach ( $transcodeStatus as $key => 
&$val ) {
                                                unset( $val['id'] );
                                                unset( $val['image_name'] );
                                                unset( $val['key'] );
diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php
index 36f5929..1622090 100644
--- a/SpecialTimedMediaHandler.php
+++ b/SpecialTimedMediaHandler.php
@@ -149,7 +149,7 @@
                                . '</tr>'
                                . "\n";
                }
-               $table .=  '</table>';
+               $table .= '</table>';
                return $table;
        }
 
@@ -157,7 +157,7 @@
                global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet, 
$wgMemc;
                $allTranscodes = array_merge( $wgEnabledTranscodeSet, 
$wgEnabledAudioTranscodeSet );
 
-               $memcKey= wfMemcKey( 'TimedMediaHandler', 'stats', '1' /* 
version */ );
+               $memcKey = wfMemcKey( 'TimedMediaHandler', 'stats', '1' /* 
version */ );
                $stats = $wgMemc->get( $memcKey );
                if ( !$stats ) {
                        $dbr = wfGetDB( DB_SLAVE );
diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index eae75c6..ded4ee2 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -22,7 +22,7 @@
                if ( $wgEnableLocalTimedText ) {
                        if ( !defined( 'NS_TIMEDTEXT' ) ) {
                                define( 'NS_TIMEDTEXT', $wgTimedTextNS );
-                               define( 'NS_TIMEDTEXT_TALK', $wgTimedTextNS +1 
);
+                               define( 'NS_TIMEDTEXT_TALK', $wgTimedTextNS + 1 
);
                        }
 
                        $list[NS_TIMEDTEXT] = 'TimedText';
@@ -73,9 +73,9 @@
                                        'mw.MwEmbedSupport',
                                ],
                        ],
-                       "mw.MediaWikiPlayerSupport" =>  $baseExtensionResource 
+ [
+                       "mw.MediaWikiPlayerSupport" => $baseExtensionResource + 
[
                                'scripts' => 
'resources/mw.MediaWikiPlayerSupport.js',
-                               'dependencies'=> [
+                               'dependencies' => [
                                        'mw.Api',
                                        'mw.MwEmbedSupport',
                                ],
@@ -212,7 +212,7 @@
                $wgTmhTheoraTwoPassEncoding, $wgWikimediaJenkinsCI;
 
                // set config for parser tests
-               if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI  
=== true ) {
+               if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI 
=== true ) {
                        global $wgEnableTranscode, $wgFFmpegLocation;
                        $wgEnableTranscode = false;
                        $wgFFmpegLocation = '/usr/bin/ffmpeg';
@@ -293,7 +293,7 @@
                                        'mediawiki.api.edit',
                                        'oojs-ui',
                                ],
-                               'messages'=> [
+                               'messages' => [
                                        'timedmedia-reset-button-cancel',
                                        'timedmedia-reset-button-dismiss',
                                        'timedmedia-reset-button-reset',
@@ -303,7 +303,7 @@
                                        'timedmedia-reset-explanation',
                                ]
                        ],
-                       'ext.tmh.TimedTextSelector' =>  $baseExtensionResource 
+ [
+                       'ext.tmh.TimedTextSelector' => $baseExtensionResource + 
[
                                'scripts' => 
'resources/ext.tmh.TimedTextSelector.js',
                        ],
                        // Add OgvJs-related modules for Safari/IE/Edge Ogg 
playback
@@ -321,7 +321,7 @@
                                'dependencies' => 'ext.tmh.OgvJsSupport',
                                'targets' => [ 'mobile', 'desktop' ],
                        ],
-                       'embedPlayerIframeStyle'=> $baseExtensionResource + [
+                       'embedPlayerIframeStyle' => $baseExtensionResource + [
                                'styles' => 'resources/embedPlayerIframe.css',
                                'targets' => [ 'mobile', 'desktop' ],
                        ],
@@ -523,7 +523,7 @@
                $mediaType = $handler->getMetadataType( $file );
                // If ogg or webm format and not audio we can "transcode" this 
file
                $isAudio = $handler instanceof TimedMediaHandler && 
$handler->isAudio( $file );
-               if ( ( $mediaType == 'webm' || $mediaType == 'ogg' || 
$mediaType =='mp4' )
+               if ( ( $mediaType == 'webm' || $mediaType == 'ogg' || 
$mediaType == 'mp4' )
                        && !$isAudio
                ) {
                        return true;
diff --git a/TimedMediaHandler.i18n.magic.php b/TimedMediaHandler.i18n.magic.php
index ea4ed3c..416c133 100644
--- a/TimedMediaHandler.i18n.magic.php
+++ b/TimedMediaHandler.i18n.magic.php
@@ -18,15 +18,15 @@
 ];
 
 $magicWords['af'] = [
-       'timedmedia_noplayer'=> [ '0', 'geenspeler', 'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'geenikoon', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'geenspeler', 'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'geenikoon', 'noicon' ],
        'timedmedia_starttime' => [ '0', 'begin=$1', 'start=$1' ],
        'timedmedia_endtime' => [ '0', 'einde=$1', 'end=$1' ],
 ];
 
 $magicWords['ar'] = [
-       'timedmedia_noplayer'=> [ '0', 'لابرنامج', 'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'لاأيقونة', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'لابرنامج', 'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'لاأيقونة', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'وقت_التصغير=$1', 'thumbtime=$1' ],
        'timedmedia_starttime' => [ '0', 'بداية=$1', 'start=$1' ],
        'timedmedia_endtime' => [ '0', 'نهاية=$1', 'end=$1' ],
@@ -38,8 +38,8 @@
 ];
 
 $magicWords['arz'] = [
-       'timedmedia_noplayer'=> [ '0', 'لابرنامج', 'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'لاأيقونة', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'لابرنامج', 'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'لاأيقونة', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'وقت_التصغير=$1', 'thumbtime=$1' ],
        'timedmedia_starttime' => [ '0', 'بداية=$1', 'start=$1' ],
        'timedmedia_endtime' => [ '0', 'نهاية=$1', 'end=$1' ],
@@ -51,8 +51,8 @@
 ];
 
 $magicWords['ml'] = [
-       'timedmedia_noplayer'=> [ '0', 'പ്ലേയറില്ല', 'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'ഐകോണില്ല', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'പ്ലേയറില്ല', 'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'ഐകോണില്ല', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'ലഘുരൂപസമയം=$1', 'thumbtime=$1' ],
        'timedmedia_starttime' => [ '0', 'തുടങ്ങുക=$1', 'start=$1' ],
        'timedmedia_endtime' => [ '0', 'നിർത്തുക=$1', 'end=$1' ],
@@ -65,22 +65,22 @@
 ];
 
 $magicWords['nds-nl'] = [
-       'timedmedia_noplayer'=> [ '0', 'gienspeuler', 'geenspeler', 'noplayer' 
],
-       'timedmedia_noicon'=> [ '0', 'gienicoon', 'geenicoon', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'gienspeuler', 'geenspeler', 'noplayer' 
],
+       'timedmedia_noicon' => [ '0', 'gienicoon', 'geenicoon', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'miniatuurtied=$1', 
'miniatuurtijd=$1', 'thumbtime=$1' ],
        'timedmedia_endtime' => [ '0', 'einde=$1', 'eind=$1', 'end=$1' ],
 ];
 
 $magicWords['nl'] = [
-       'timedmedia_noplayer'=> [ '0', 'geenspeler', 'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'geenicoon', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'geenspeler', 'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'geenicoon', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'miniatuurtijd=$1', 'thumbtime=$1' ],
        'timedmedia_endtime' => [ '0', 'eind=$1', 'end=$1' ],
 ];
 
 $magicWords['ru'] = [
-       'timedmedia_noplayer'=> [ '0', 'нетпроигрывателя', 'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'нетзначка', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'нетпроигрывателя', 'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'нетзначка', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'времямини=$1', 'thumbtime=$1' ],
        'timedmedia_starttime' => [ '0', 'начало=$1', 'start=$1' ],
        'timedmedia_endtime' => [ '0', 'окончание=$1', 'end=$1' ],
@@ -88,8 +88,8 @@
 ];
 
 $magicWords['uk'] = [
-       'timedmedia_noplayer'=> [ '0', 'немаєпрогравача', 'нетпроигрывателя', 
'noplayer' ],
-       'timedmedia_noicon'=> [ '0', 'немаєзначка', 'нетзначка', 'noicon' ],
+       'timedmedia_noplayer' => [ '0', 'немаєпрогравача', 'нетпроигрывателя', 
'noplayer' ],
+       'timedmedia_noicon' => [ '0', 'немаєзначка', 'нетзначка', 'noicon' ],
        'timedmedia_thumbtime' => [ '0', 'часміні=$1', 'времямини=$1', 
'thumbtime=$1' ],
        'timedmedia_starttime' => [ '0', 'початок=$1', 'начало=$1', 'start=$1' 
],
        'timedmedia_endtime' => [ '0', 'закінчення=$1', 'окончание=$1', 
'end=$1' ],
diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php
index bfb2c47..318b927 100644
--- a/TimedMediaHandler_body.php
+++ b/TimedMediaHandler_body.php
@@ -68,14 +68,14 @@
         */
        function makeParamString( $params ) {
                // Add the width param string ( same as images {width}px )
-               $paramString ='';
-               $paramString.= ( isset( $params['width'] ) )?  $params['width'] 
. 'px' : '';
-               $paramString.= ( $paramString != '' )? '-' : '';
+               $paramString = '';
+               $paramString .= ( isset( $params['width'] ) ) ? 
$params['width'] . 'px' : '';
+               $paramString .= ( $paramString != '' ) ? '-' : '';
 
                // Get the raw thumbTime from thumbtime or start param
-               if ( isset ( $params['thumbtime'] ) ) {
+               if ( isset( $params['thumbtime'] ) ) {
                        $thumbTime = $params['thumbtime'];
-               } elseif ( isset ( $params['start'] ) ) {
+               } elseif ( isset( $params['start'] ) ) {
                        $thumbTime = $params['start'];
                } else {
                        $thumbTime = false;
@@ -256,10 +256,10 @@
         */
        public static function getTimePassedMsg( $timePassed ) {
                $t = [];
-               $t['days'] = floor( $timePassed/60/60/24 );
-               $t['hours'] = floor( $timePassed/60/60 )%24;
-               $t['minutes'] = floor( $timePassed/60 )%60;
-               $t['seconds'] = $timePassed%60;
+               $t['days'] = floor( $timePassed / 60 / 60 / 24 );
+               $t['hours'] = floor( $timePassed / 60 / 60 ) % 24;
+               $t['minutes'] = floor( $timePassed / 60 ) % 60;
+               $t['seconds'] = $timePassed % 60;
 
                foreach ( $t as $k => $v ) {
                        if ( $v == 0 ) {
@@ -383,7 +383,7 @@
                        'start' => isset( $params['start'] ) ? $params['start'] 
: false,
                        'end' => isset( $params['end'] ) ? $params['end'] : 
false,
                        'fillwindow' => isset( $params['fillwindow'] ) ? 
$params['fillwindow'] : false,
-                       'disablecontrols' => isset ( $params['disablecontrols'] 
) ? $params['disablecontrols'] : false
+                       'disablecontrols' => isset( $params['disablecontrols'] 
) ? $params['disablecontrols'] : false
                ];
 
                // No thumbs for audio
diff --git a/TimedMediaThumbnail.php b/TimedMediaThumbnail.php
index c68fa49..7a00c18 100644
--- a/TimedMediaThumbnail.php
+++ b/TimedMediaThumbnail.php
@@ -122,7 +122,7 @@
                // getFileHttpUrl was only added in mw 1.21, dont fail if it 
does not exist
                if ( method_exists( $backend, 'getFileHttpUrl' ) ) {
                        $src = $backend->getFileHttpUrl( [
-                               'src' =>  $options['file']->getPath()
+                               'src' => $options['file']->getPath()
                        ] );
                } else {
                        $src = null;
diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index 02d296a..055e520 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -200,12 +200,12 @@
                                'alt' => $this->file->getTitle(),
                                'style' => "width:" . $this->getPlayerWidth() . 
"px;height:" .
                                                        
$this->getPlayerHeight() . "px",
-                               'src' =>  $this->getUrl(),
+                               'src' => $this->getUrl(),
                        ], '' )
                        .
                        // For javascript disabled browsers provide a link to 
the asset:
                        Xml::tags( 'a', [
-                                       'href'=> $this->file->getUrl(),
+                                       'href' => $this->file->getUrl(),
                                        'title' => wfMessage( 
'timedmedia-play-media' )->escaped(),
                                        'target' => 'new'
                                ],
@@ -406,7 +406,7 @@
                $offset = floatval( $this->offset );
 
                $width = $sizeOverride ? $sizeOverride[0] : 
$this->getPlayerWidth();
-               $height = $sizeOverride ? $sizeOverride[1]: 
$this->getPlayerHeight();
+               $height = $sizeOverride ? $sizeOverride[1] : 
$this->getPlayerHeight();
 
                if ( $this->fillwindow ) {
                        $width = '100%';
@@ -425,10 +425,10 @@
 
                        // Note we set controls to true ( for no-js players ) 
when mwEmbed rewrites the interface
                        // it updates the controls attribute of the embed video
-                       'controls'=> 'true',
+                       'controls' => 'true',
                        // Since we will reload the item with javascript,
                        // tell browser to not load the video before
-                       'preload'=>'none',
+                       'preload' => 'none',
                ];
 
                if ( $autoPlay === true ) {
diff --git a/TimedTextPage.php b/TimedTextPage.php
index 82642d2..3a08523 100644
--- a/TimedTextPage.php
+++ b/TimedTextPage.php
@@ -99,7 +99,7 @@
 
                // Get the video with with a max of 600 pixel page
                $out->addHTML(
-                       Xml::tags( 'table', [ 'style'=> 'border:none' ],
+                       Xml::tags( 'table', [ 'style' => 'border:none' ],
                                Xml::tags( 'tr', null,
                                        Xml::tags( 'td', [ 'valign' => 'top',  
'width' => self::$videoWidth ],
                                                $this->getVideoHTML( 
$videoTitle )
diff --git a/TranscodeStatusTable.php b/TranscodeStatusTable.php
index e801ef1..b14571a 100644
--- a/TranscodeStatusTable.php
+++ b/TranscodeStatusTable.php
@@ -23,7 +23,7 @@
                        $file->getTitle(),
                        wfMessage( 'timedmedia-update-status' )->escaped(),
                        [],
-                       [ 'action'=> 'purge' ]
+                       [ 'action' => 'purge' ]
                );
 
                $o .= self::getTranscodesTable( $file );
@@ -133,7 +133,7 @@
 
                        $o .= '</tr>';
                }
-               $o .=  Xml::closeElement( 'table' );
+               $o .= Xml::closeElement( 'table' );
 
                return $o;
        }
diff --git a/WebVideoTranscode/WebVideoTranscode.php 
b/WebVideoTranscode/WebVideoTranscode.php
index 253fdc2..678bc79 100644
--- a/WebVideoTranscode/WebVideoTranscode.php
+++ b/WebVideoTranscode/WebVideoTranscode.php
@@ -652,7 +652,7 @@
        public static function getRemoteSources( &$file, $options = [] ) {
                global $wgMemc;
                // Setup source attribute options
-               $dataPrefix = in_array( 'nodata', $options )? '': 'data-';
+               $dataPrefix = in_array( 'nodata', $options ) ? '' : 'data-';
 
                // Use descriptionCacheExpiry as our expire for timed text 
tracks info
                if ( $file->repo->descriptionCacheExpiry > 0 ) {
@@ -946,7 +946,7 @@
         */
        public static function getPrimarySourceAttributes( $file, $options = [] 
) {
                global $wgLang;
-               $src = in_array( 'fullurl', $options )?  wfExpandUrl( 
$file->getUrl() ) : $file->getUrl();
+               $src = in_array( 'fullurl', $options ) ? wfExpandUrl( 
$file->getUrl() ) : $file->getUrl();
 
                $bitrate = $file->getHandler()->getBitrate( $file );
                $metadataType = $file->getHandler()->getMetadataType( $file );
@@ -1013,11 +1013,11 @@
                        );
                }
 
-               $framerate = ( isset( 
self::$derivativeSettings[$transcodeKey]['framerate'] ) )?
+               $framerate = ( isset( 
self::$derivativeSettings[$transcodeKey]['framerate'] ) ) ?
                                                
self::$derivativeSettings[$transcodeKey]['framerate'] :
                                                
$file->getHandler()->getFramerate( $file );
                // Setup the url src:
-               $src = in_array( 'fullurl', $options ) ?  wfExpandUrl( $src ) : 
$src;
+               $src = in_array( 'fullurl', $options ) ? wfExpandUrl( $src ) : 
$src;
                $fields = [
                                'src' => $src,
                                'title' => wfMessage( 
'timedmedia-derivative-desc-' . $transcodeKey )->text(),
@@ -1110,7 +1110,7 @@
         *
         * @param $file File object
         * @param $transcodeKey String transcode key
-        * @return boolean
+        * @return bool
         */
        public static function isTranscodeEnabled( File $file, $transcodeKey ) {
                global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet;
@@ -1212,7 +1212,7 @@
         * Check if this transcode belongs to the high-priority queue.
         * @param $file File
         * @param $transcodeKey string
-        * @return boolean
+        * @return bool
         */
        public static function isTranscodePrioritized( File $file, 
$transcodeKey ) {
                global $wgTmhPriorityResolutionThreshold, 
$wgTmhPriorityLengthThreshold;
@@ -1277,8 +1277,8 @@
                        }
                }
                // some players do not like uneven frame sizes
-               $targetWidth += $targetWidth%2;
-               $targetHeight += $targetHeight%2;
+               $targetWidth += $targetWidth % 2;
+               $targetHeight += $targetHeight % 2;
                return [ $targetWidth, $targetHeight ];
        }
 
diff --git a/WebVideoTranscode/WebVideoTranscodeJob.php 
b/WebVideoTranscode/WebVideoTranscodeJob.php
index 7c677b7..4bec851 100644
--- a/WebVideoTranscode/WebVideoTranscodeJob.php
+++ b/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -116,7 +116,7 @@
 
        /**
         * Run the transcode request
-        * @return boolean success
+        * @return bool success
         */
        public function run() {
                global $wgVersion, $wgFFmpeg2theoraLocation;
@@ -213,7 +213,7 @@
                        }
                } else {
                        wfDebug( 'Error unknown codec:' . 
$options['videoCodec'] );
-                       $status =  'Error unknown target encode codec:' . 
$options['videoCodec'];
+                       $status = 'Error unknown target encode codec:' . 
$options['videoCodec'];
                }
 
                // Remove any log files,
@@ -285,7 +285,7 @@
                                $status = false;
                        } else {
                                $bitrate = round(
-                                       intval( filesize( 
$this->getTargetEncodePath() ) /  $file->getLength() ) * 8
+                                       intval( filesize( 
$this->getTargetEncodePath() ) / $file->getLength() ) * 8
                                );
                                // wfRestoreWarnings();
                                // Reconnect to the database...
@@ -333,7 +333,7 @@
        }
 
        function removeFfmpegLogFiles() {
-               $path =  $this->getTargetEncodePath();
+               $path = $this->getTargetEncodePath();
                $dir = dirname( $path );
                if ( is_dir( $dir ) ) {
                        $dh = opendir( $dir );
@@ -396,7 +396,7 @@
                }
                // Check for end time:
                if ( isset( $options['endtime'] ) ) {
-                       $cmd .= ' -t ' . intval( $options['endtime'] )  - 
intval( $options['starttime'] );
+                       $cmd .= ' -t ' . intval( $options['endtime'] ) - 
intval( $options['starttime'] );
                }
 
                if ( $pass == 1 || isset( $options['noaudio'] ) ) {
@@ -466,7 +466,7 @@
                        $cmd .= " -b " . wfEscapeShellArg( 
$options['videoBitrate'] );
                }
                // Output mp4
-               $cmd .=" -f mp4";
+               $cmd .= " -f mp4";
                return $cmd;
        }
 
@@ -521,7 +521,7 @@
                // Get a local pointer to the file object
                $file = $this->getFile();
 
-               $cmd =' -threads ' . intval( $wgFFmpegThreads );
+               $cmd = ' -threads ' . intval( $wgFFmpegThreads );
 
                // check for presets:
                if ( isset( $options['preset'] ) ) {
@@ -535,7 +535,7 @@
                }
 
                // Add the boiler plate vp8 ffmpeg command:
-               $cmd .=" -skip_threshold 0 -bufsize 6000k -rc_init_occupancy 
4000";
+               $cmd .= " -skip_threshold 0 -bufsize 6000k -rc_init_occupancy 
4000";
 
                // Check for video quality:
                if ( isset( $options['videoQuality'] ) && 
$options['videoQuality'] >= 0 ) {
@@ -573,7 +573,7 @@
                }
 
                // Output WebM
-               $cmd .=" -f webm";
+               $cmd .= " -f webm";
 
                return $cmd;
        }
@@ -594,7 +594,7 @@
                // Get a local pointer to the file object
                $file = $this->getFile();
 
-               $cmd =' -threads ' . intval( $wgFFmpegThreads );
+               $cmd = ' -threads ' . intval( $wgFFmpegThreads );
 
                // Check for video quality:
                if ( isset( $options['videoQuality'] ) && 
$options['videoQuality'] >= 0 ) {
@@ -625,7 +625,7 @@
                }
 
                // Output Ogg
-               $cmd .=" -f ogg";
+               $cmd .= " -f ogg";
 
                return $cmd;
        }
@@ -636,7 +636,7 @@
         * @return string
         */
        function ffmpegAddAudioOptions( $options, $pass ) {
-               $cmd ='';
+               $cmd = '';
                if ( isset( $options['audioQuality'] ) ) {
                        $cmd .= " -aq " . wfEscapeShellArg( 
$options['audioQuality'] );
                }
@@ -901,7 +901,7 @@
 
                        // Check if we have global job run-time has been 
exceeded:
                        if (
-                               $wgTranscodeBackgroundTimeLimit && time() - 
$startTime  > $wgTranscodeBackgroundTimeLimit
+                               $wgTranscodeBackgroundTimeLimit && time() - 
$startTime > $wgTranscodeBackgroundTimeLimit
                        ) {
                                $errorMsg = "Encoding exceeded max job run time 
( "
                                        . TimedMediaHandler::seconds2npt( 
$wgTranscodeBackgroundTimeLimit ) . " ), kill process.";
@@ -929,8 +929,8 @@
 
                // return the encoding log contents ( will be inserted into 
error table if an error )
                // ( will be ignored and removed if success )
-               if ( $errorMsg!= '' ) {
-                       $errorMsg .="\n\n";
+               if ( $errorMsg != '' ) {
+                       $errorMsg .= "\n\n";
                }
                return $errorMsg . file_get_contents( $encodingLog );
        }
@@ -980,7 +980,7 @@
                'height'                => "--height",
                'maxSize'               => "--max_size",
                'noUpscaling'   => "--no-upscaling",
-               'videoQuality'=> "-v",
+               'videoQuality' => "-v",
                'videoBitrate'  => "-V",
                'twopass'               => "--two-pass",
                'optimize'              => "--optimize",
@@ -992,7 +992,7 @@
                'cropBottom'    => "--cropbottom",
                'cropLeft'              => "--cropleft",
                'cropRight'             => "--cropright",
-               'keyframeInterval'=> "--keyint",
+               'keyframeInterval' => "--keyint",
                'denoise'               => [ "--pp", "de" ],
                'deinterlace'   => "--deinterlace",
                'novideo'               => [ "--novideo", "--no-skeleton" ],
diff --git a/composer.json b/composer.json
index 7522714..b79affc 100644
--- a/composer.json
+++ b/composer.json
@@ -4,7 +4,7 @@
        },
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
-               "mediawiki/mediawiki-codesniffer": "0.10.1",
+               "mediawiki/mediawiki-codesniffer": "0.11.0",
                "jakub-onderka/php-console-highlighter": "0.3.2"
        },
        "scripts": {
diff --git a/handlers/FLACHandler/FLACHandler.php 
b/handlers/FLACHandler/FLACHandler.php
index fb3fe47..95cf059 100644
--- a/handlers/FLACHandler/FLACHandler.php
+++ b/handlers/FLACHandler/FLACHandler.php
@@ -33,7 +33,7 @@
                }
 
                if ( isset( $metadata['audio'] ) && 
$metadata['audio']['dataformat'] == 'flac' ) {
-                       $streamTypes[] =  'FLAC';
+                       $streamTypes[] = 'FLAC';
                }
 
                return $streamTypes;
diff --git a/handlers/Mp3Handler/Mp3Handler.php 
b/handlers/Mp3Handler/Mp3Handler.php
index f36c8c7..7cde667 100644
--- a/handlers/Mp3Handler/Mp3Handler.php
+++ b/handlers/Mp3Handler/Mp3Handler.php
@@ -28,7 +28,7 @@
                        return false;
                }
                if ( isset( $metadata['audio'] ) && 
$metadata['audio']['dataformat'] == 'mp3' ) {
-                       $streamTypes[] =  'MP3';
+                       $streamTypes[] = 'MP3';
                }
                return $streamTypes;
        }
diff --git a/handlers/Mp4Handler/Mp4Handler.php 
b/handlers/Mp4Handler/Mp4Handler.php
index 42d057d..03d6001 100644
--- a/handlers/Mp4Handler/Mp4Handler.php
+++ b/handlers/Mp4Handler/Mp4Handler.php
@@ -88,14 +88,14 @@
                                &&
                                strpos( $metadata['audio']['codec'], 'AAC' ) 
!== false
                        ) {
-                               $streamTypes[] =  'AAC';
+                               $streamTypes[] = 'AAC';
                        } else {
                                $streamTypes[] = $metadata['audio']['codec'];
                        }
                }
                // id3 gives 'V_VP8' for what we call VP8
                if ( isset( $metadata['video'] ) && 
$metadata['video']['dataformat'] == 'quicktime' ) {
-                       $streamTypes[] =  'h.264';
+                       $streamTypes[] = 'h.264';
                }
 
                return $streamTypes;
diff --git a/handlers/OggHandler/OggHandler.php 
b/handlers/OggHandler/OggHandler.php
index e4bf5f4..2690220 100644
--- a/handlers/OggHandler/OggHandler.php
+++ b/handlers/OggHandler/OggHandler.php
@@ -207,7 +207,7 @@
         * @param $file File
         */
        function getWebType( $file ) {
-               $baseType =  ( $file->getWidth() == 0 && $file->getHeight() == 
0 )? 'audio' : 'video';
+               $baseType = ( $file->getWidth() == 0 && $file->getHeight() == 0 
) ? 'audio' : 'video';
                $baseType .= '/ogg';
                $streamTypes = $this->getStreamTypes( $file );
                if ( !$streamTypes ) {
diff --git a/handlers/TextHandler/TextHandler.php 
b/handlers/TextHandler/TextHandler.php
index 56efddc..3ad1e09 100644
--- a/handlers/TextHandler/TextHandler.php
+++ b/handlers/TextHandler/TextHandler.php
@@ -66,7 +66,7 @@
                        // Get the namespace data from the image api repo:
                        // fetchImageQuery query caches results
                        $data = $this->file->getRepo()->fetchImageQuery( [
-                               'meta' =>'siteinfo',
+                               'meta' => 'siteinfo',
                                'siprop' => 'namespaces'
                        ] );
 
@@ -249,7 +249,7 @@
                                'type' => $contentType,
                                'title' => $this->getPrefixedDBkey( $subTitle ),
                                'provider' => $providerName,
-                               'srclang' =>  $languageKey,
+                               'srclang' => $languageKey,
                                'dir' => Language::factory( $languageKey 
)->getDir(),
                                'label' => wfMessage( 
'timedmedia-subtitle-language',
                                        $langNames[ $languageKey ],
diff --git a/handlers/WAVHandler/WAVHandler.php 
b/handlers/WAVHandler/WAVHandler.php
index c7b2fe1..b21fd85 100644
--- a/handlers/WAVHandler/WAVHandler.php
+++ b/handlers/WAVHandler/WAVHandler.php
@@ -47,7 +47,7 @@
                }
 
                if ( isset( $metadata['audio'] ) && 
$metadata['audio']['dataformat'] == 'wav' ) {
-                       $streamTypes[] =  'WAV';
+                       $streamTypes[] = 'WAV';
                }
 
                return $streamTypes;
diff --git a/handlers/WebMHandler/WebMHandler.php 
b/handlers/WebMHandler/WebMHandler.php
index 668b157..708a46a 100644
--- a/handlers/WebMHandler/WebMHandler.php
+++ b/handlers/WebMHandler/WebMHandler.php
@@ -91,7 +91,7 @@
         * @return String
         */
        function getWebType( $file ) {
-               $baseType =  ( $file->getWidth() == 0 && $file->getHeight() == 
0 )? 'audio' : 'video';
+               $baseType = ( $file->getWidth() == 0 && $file->getHeight() == 0 
) ? 'audio' : 'video';
 
                $streams = $this->getStreamTypes( $file );
                if ( !$streams ) {
@@ -115,17 +115,17 @@
                }
                // id3 gives 'V_VP8' for what we call VP8
                if ( isset( $metadata['video'] ) && 
$metadata['video']['dataformat'] == 'vp8' ) {
-                       $streamTypes[] =  'VP8';
+                       $streamTypes[] = 'VP8';
                } elseif ( isset( $metadata['video'] ) &&
                        ( $metadata['video']['dataformat'] === 'vp9'
                        || $metadata['video']['dataformat'] === 'V_VP9'
                ) ) {
                        // Currently getID3 calls it V_VP9. That will probably 
change to vp9
                        // once getID3 actually gets support for the codec.
-                       $streamTypes[] =  'VP9';
+                       $streamTypes[] = 'VP9';
                }
                if ( isset( $metadata['audio'] ) && 
$metadata['audio']['dataformat'] == 'vorbis' ) {
-                       $streamTypes[] =  'Vorbis';
+                       $streamTypes[] = 'Vorbis';
                } elseif ( isset( $metadata['audio'] ) &&
                        ( $metadata['audio']['dataformat'] == 'opus'
                        || $metadata['audio']['dataformat'] == 'A_OPUS'
diff --git a/phpcs.xml b/phpcs.xml
index 9ff48ff..d9d9356 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,8 +1,15 @@
 <?xml version="1.0"?>
 <ruleset>
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <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.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
-               <exclude name="MediaWiki.Commenting.FunctionComment"/>
        </rule>
        <rule ref="Generic.Files.LineLength">
                <exclude-pattern>TimedMediaHandler.i18n.*.php</exclude-pattern>

-- 
To view, visit https://gerrit.wikimedia.org/r/371408
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I39f584dceb8564e60148064855179fe8a6bc3be8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to