Pass phpcs-strict on includes/objectcache/
authorSiebrand Mazeland <siebrand@kitano.nl>
Sun, 11 May 2014 09:08:36 +0000 (11:08 +0200)
committerReedy <reedy@wikimedia.org>
Sun, 11 May 2014 16:52:18 +0000 (16:52 +0000)
Change-Id: Ib99f2e34255df0cc846727b134d1788aec48529d

includes/objectcache/HashBagOStuff.php
includes/objectcache/MemcachedClient.php
includes/objectcache/MultiWriteBagOStuff.php
includes/objectcache/ObjectCache.php
includes/objectcache/SqlBagOStuff.php

index db0e579..6e50a8c 100644 (file)
@@ -28,7 +28,8 @@
  * @ingroup Cache
  */
 class HashBagOStuff extends BagOStuff {
-       var $bag;
+       /** @var array */
+       protected $bag;
 
        function __construct() {
                $this->bag = array();
index bc59c6f..9de840b 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+// @codingStandardsIgnoreFile It's an external lib and it isn't. Let's not bother.
 /**
  * Memcached client for PHP.
  *
index c656bdd..497f75d 100644 (file)
@@ -29,7 +29,8 @@
  * @ingroup Cache
  */
 class MultiWriteBagOStuff extends BagOStuff {
-       var $caches;
+       /** @var array BagOStuff[] */
+       protected $caches;
 
        /**
         * Constructor. Parameters are:
index 3be251c..0009999 100644 (file)
@@ -27,7 +27,7 @@
  * @ingroup Cache
  */
 class ObjectCache {
-       static $instances = array();
+       public static $instances = array();
 
        /**
         * Get a cached instance of the specified type of cache object.
@@ -87,8 +87,9 @@ class ObjectCache {
                        $class = $params['class'];
                        return new $class( $params );
                } else {
-                       throw new MWException( "The definition of cache type \"" . print_r( $params, true ) . "\" lacks both " .
-                               "factory and class parameters." );
+                       throw new MWException( "The definition of cache type \""
+                               . print_r( $params, true ) . "\" lacks both "
+                               . "factory and class parameters." );
                }
        }
 
index e6a8c45..bcd5942 100644 (file)
  * @ingroup Cache
  */
 class SqlBagOStuff extends BagOStuff {
-       /**
-        * @var LoadBalancer
-        */
-       var $lb;
+       /** @var LoadBalancer */
+       protected $lb;
+
+       protected $serverInfos;
+
+       /** @var array */
+       protected $serverNames;
+
+       /** @var int */
+       protected $numServers;
+
+       /** @var array */
+       protected $conns;
+
+       /** @var int */
+       protected $lastExpireAll = 0;
 
-       var $serverInfos;
-       var $serverNames;
-       var $numServers;
-       var $conns;
-       var $lastExpireAll = 0;
-       var $purgePeriod = 100;
-       var $shards = 1;
-       var $tableName = 'objectcache';
+       /** @var int */
+       protected $purgePeriod = 100;
 
-       protected $connFailureTimes = array(); // UNIX timestamps
-       protected $connFailureErrors = array(); // exceptions
+       /** @var int */
+       protected $shards = 1;
+
+       /** @var string */
+       protected $tableName = 'objectcache';
+
+       /** @var array UNIX timestamps */
+       protected $connFailureTimes = array();
+
+       /** @var array Exceptions */
+       protected $connFailureErrors = array();
 
        /**
         * Constructor. Parameters are:
@@ -721,7 +736,8 @@ class SqlBagOStuff extends BagOStuff {
                if ( $exception->db && $exception->db->wasReadOnlyError() ) {
                        try {
                                $exception->db->rollback( __METHOD__ );
-                       } catch ( DBError $e ) {}
+                       } catch ( DBError $e ) {
+                       }
                }
                wfDebugLog( 'SQLBagOStuff', "DBError: {$exception->getMessage()}" );
                if ( $exception instanceof DBConnectionError ) {
@@ -780,4 +796,5 @@ class SqlBagOStuff extends BagOStuff {
 /**
  * Backwards compatibility alias
  */
-class MediaWikiBagOStuff extends SqlBagOStuff { }
+class MediaWikiBagOStuff extends SqlBagOStuff {
+}