Documentation: Replace misuse of 'later' when we meant 'latter'
[lhc/web/wiklou.git] / includes / poolcounter / PoolCounterRedis.php
index 6dd0b35..5e8db07 100644 (file)
@@ -93,8 +93,8 @@ class PoolCounterRedis extends PoolCounter {
                $this->lockTTL = $met ? 2 * $met : 3600;
 
                if ( self::$active === null ) {
-                       self::$active = array();
-                       register_shutdown_function( array( __CLASS__, 'releaseAll' ) );
+                       self::$active = [];
+                       register_shutdown_function( [ __CLASS__, 'releaseAll' ] );
                }
        }
 
@@ -191,7 +191,7 @@ LUA;
 
                try {
                        $conn->luaEval( $script,
-                               array(
+                               [
                                        $this->getSlotListKey(),
                                        $this->getSlotRTimeSetKey(),
                                        $this->getWakeupListKey(),
@@ -202,7 +202,7 @@ LUA;
                                        $this->slotTime, // used for CAS-style sanity check
                                        ( $this->onRelease === self::AWAKE_ALL ) ? 1 : 0,
                                        microtime( true )
-                               ),
+                               ],
                                4 # number of first argument(s) that are keys
                        );
                } catch ( RedisException $e ) {
@@ -246,13 +246,13 @@ LUA;
                        } elseif ( $slot === 'QUEUE_WAIT' ) {
                                // This process is now registered as waiting
                                $keys = ( $doWakeup == self::AWAKE_ALL )
-                                       // Wait for an open slot or wake-up signal (preferring the later)
-                                       ? array( $this->getWakeupListKey(), $this->getSlotListKey() )
+                                       // Wait for an open slot or wake-up signal (preferring the latter)
+                                       ? [ $this->getWakeupListKey(), $this->getSlotListKey() ]
                                        // Just wait for an actual pool slot
-                                       : array( $this->getSlotListKey() );
+                                       : [ $this->getSlotListKey() ];
 
                                $res = $conn->blPop( $keys, $this->timeout );
-                               if ( $res === array() ) {
+                               if ( $res === [] ) {
                                        $conn->zRem( $this->getWaitSetKey(), $this->session ); // no longer waiting
                                        return Status::newGood( PoolCounter::TIMEOUT );
                                }
@@ -292,7 +292,7 @@ LUA;
                local rMaxWorkers,rMaxQueue,rTimeout,rExpiry,rSess,rTime = unpack(ARGV)
                -- Initialize if the "next release" time sorted-set is empty. The slot key
                -- itself is empty if all slots are busy or when nothing is initialized.
-               -- If the list is empty but the set is not, then it is the later case.
+               -- If the list is empty but the set is not, then it is the latter case.
                -- For sanity, if the list exists but not the set, then reset everything.
                if redis.call('exists',kSlotsNextRelease) == 0 then
                        redis.call('del',kSlots)
@@ -332,7 +332,7 @@ LUA;
                return slot
 LUA;
                return $conn->luaEval( $script,
-                       array(
+                       [
                                $this->getSlotListKey(),
                                $this->getSlotRTimeSetKey(),
                                $this->getWaitSetKey(),
@@ -342,7 +342,7 @@ LUA;
                                $this->lockTTL,
                                $this->session,
                                $now
-                       ),
+                       ],
                        3 # number of first argument(s) that are keys
                );
        }
@@ -371,7 +371,7 @@ LUA;
                return 1
 LUA;
                return $conn->luaEval( $script,
-                       array(
+                       [
                                $this->getSlotListKey(),
                                $this->getSlotRTimeSetKey(),
                                $this->getWaitSetKey(),
@@ -379,7 +379,7 @@ LUA;
                                $this->lockTTL,
                                $this->session,
                                $now
-                       ),
+                       ],
                        3 # number of first argument(s) that are keys
                );
        }