Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/105472


Change subject: Update code, add function levle type hints
......................................................................

Update code, add function levle type hints

Change-Id: Iaf158375cf41942ad6122b1a6a596483185e207e
---
M UserDailyContribs.hooks.php
M api/ApiUserDailyContribs.php
2 files changed, 16 insertions(+), 24 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UserDailyContribs 
refs/changes/72/105472/1

diff --git a/UserDailyContribs.hooks.php b/UserDailyContribs.hooks.php
index 1a10f27..b775ce6 100644
--- a/UserDailyContribs.hooks.php
+++ b/UserDailyContribs.hooks.php
@@ -7,28 +7,21 @@
  */
 
 class UserDailyContribsHooks {
-
-       /* Static Methods */
-
        /**
         * LoadExtensionSchemaUpdates hook
+        * @param DatabaseUpdater $updater
+        * @return bool true
         */
        public static function loadExtensionSchemaUpdates( $updater = null ) {
-               if ( $updater === null ) {
-                       global $wgExtNewTables;
-                       $wgExtNewTables[] = array( 'user_daily_contribs', 
dirname( __FILE__ ) . '/patches/UserDailyContribs.sql' );
-               } else {
-                       $updater->addExtensionUpdate( array( 'addTable', 
'user_daily_contribs',
-                               dirname( __FILE__ ) . 
'/patches/UserDailyContribs.sql', true ) );
-               }
+               $updater->addExtensionTable( 'user_daily_contribs', dirname( 
__FILE__ ) . '/patches/UserDailyContribs.sql' );
                return true;
        }
 
        /**
         * ParserTestTables hook
         *
-        * @param $tables
-        * @return unknown_type
+        * @param array$tables
+        * @return bool
         */
        public static function parserTestTables( &$tables ) {
                $tables[] = 'user_daily_contribs';
@@ -40,6 +33,15 @@
         *
         * Stores a new contribution
         *
+        * @param $article
+        * @param User $user
+        * @param $text
+        * @param $summary
+        * @param $minoredit
+        * @param $watchthis
+        * @param $sectionanchor
+        * @param $flags
+        * @param Revision $revision
         * @return true
         */
        public static function articleSaveComplete( $article, $user, $text, 
$summary,
@@ -56,7 +58,7 @@
 
                $method = __METHOD__;
                $dbw = wfGetDB( DB_MASTER );
-               $callback = function() use ( $dbw, $user, $method ) {
+               $dbw->onTransactionIdle( function() use ( $dbw, $user, $method 
) {
                        $today = gmdate( 'Ymd', time() );
                        $dbw->update(
                                'user_daily_contribs',
@@ -80,12 +82,7 @@
                                        );
                                }
                        }
-               };
-               if ( method_exists( 'DatabaseBase', 'onTransactionIdle' ) ) {
-                       $dbw->onTransactionIdle( $callback );
-               } else {
-                       $callback();
-               }
+               } );
                return true;
        }
 }
diff --git a/api/ApiUserDailyContribs.php b/api/ApiUserDailyContribs.php
index b5fe136..d6af8fe 100644
--- a/api/ApiUserDailyContribs.php
+++ b/api/ApiUserDailyContribs.php
@@ -82,9 +82,4 @@
        protected function getExamples() {
                return 
'api.php?action=userdailycontribs&user=WikiSysop&daysago=5';
        }
-
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
-       }
-
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf158375cf41942ad6122b1a6a596483185e207e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UserDailyContribs
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to