Change ResultWrapper to IResultWrapper in pagers and special pages
[lhc/web/wiklou.git] / includes / specials / SpecialMediaStatistics.php
index 83efbcb..943fa57 100644 (file)
@@ -22,7 +22,7 @@
  * @author Brian Wolff
  */
 
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
 
 /**
@@ -30,13 +30,15 @@ use Wikimedia\Rdbms\IDatabase;
  */
 class MediaStatisticsPage extends QueryPage {
        protected $totalCount = 0, $totalBytes = 0;
+
        /**
-       * @var integer $totalPerType Combined file size of all files in a section
-       */
+        * @var int $totalPerType Combined file size of all files in a section
+        */
        protected $totalPerType = 0;
+
        /**
-       * @var integer $totalSize Combined file size of all files
-       */
+        * @var int $totalSize Combined file size of all files
+        */
        protected $totalSize = 0;
 
        function __construct( $name = 'MediaStatistics' ) {
@@ -63,6 +65,7 @@ class MediaStatisticsPage extends QueryPage {
         * come out of querycache table is the order they went in. Which is hacky.
         * However, other special pages like Special:Deadendpages and
         * Special:BrokenRedirects also rely on this.
+        * @return array
         */
        public function getQueryInfo() {
                $dbr = wfGetDB( DB_REPLICA );
@@ -111,7 +114,7 @@ class MediaStatisticsPage extends QueryPage {
         * @param OutputPage $out
         * @param Skin $skin (deprecated presumably)
         * @param IDatabase $dbr
-        * @param ResultWrapper $res Results from query
+        * @param IResultWrapper $res Results from query
         * @param int $num Number of results
         * @param int $offset Paging offset (Should always be 0 in our case)
         */
@@ -197,7 +200,7 @@ class MediaStatisticsPage extends QueryPage {
                $row .= Html::rawElement(
                        'td',
                        // Make sure js sorts it in numeric order
-                       [ 'data-sort-value' =>  $bytes ],
+                       [ 'data-sort-value' => $bytes ],
                        $this->msg( 'mediastatistics-nbytes' )
                                ->numParams( $bytes )
                                ->sizeParams( $bytes )
@@ -234,7 +237,8 @@ class MediaStatisticsPage extends QueryPage {
         * @return string Comma separated list of allowed extensions (e.g. ".ogg, .oga")
         */
        private function getExtensionList( $mime ) {
-               $exts = MimeMagic::singleton()->getExtensionsForType( $mime );
+               $exts = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()
+                       ->getExtensionsForType( $mime );
                if ( $exts === null ) {
                        return '';
                }
@@ -251,6 +255,7 @@ class MediaStatisticsPage extends QueryPage {
         * Output the start of the table
         *
         * Including opening <table>, and first <tr> with column headers.
+        * @param string $mediaType
         */
        protected function outputTableStart( $mediaType ) {
                $this->getOutput()->addHTML(
@@ -351,7 +356,7 @@ class MediaStatisticsPage extends QueryPage {
         * Initialize total values so we can figure out percentages later.
         *
         * @param IDatabase $dbr
-        * @param ResultWrapper $res
+        * @param IResultWrapper $res
         */
        public function preprocessResults( $dbr, $res ) {
                $this->executeLBFromResultWrapper( $res );