diff options
Diffstat (limited to 'includes/libs')
-rw-r--r-- | includes/libs/filebackend/FileBackend.php | 4 | ||||
-rw-r--r-- | includes/libs/filebackend/filejournal/FileJournal.php | 2 | ||||
-rw-r--r-- | includes/libs/lockmanager/FSLockManager.php | 2 | ||||
-rw-r--r-- | includes/libs/lockmanager/PostgreSqlLockManager.php | 2 | ||||
-rw-r--r-- | includes/libs/lockmanager/QuorumLockManager.php | 4 | ||||
-rw-r--r-- | includes/libs/rdbms/ChronologyProtector.php | 2 | ||||
-rw-r--r-- | includes/libs/rdbms/database/Database.php | 2 | ||||
-rw-r--r-- | includes/libs/rdbms/database/DatabaseMysqlBase.php | 2 | ||||
-rw-r--r-- | includes/libs/rdbms/loadbalancer/LoadBalancer.php | 4 |
9 files changed, 12 insertions, 12 deletions
diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php index 27e69244763f..e32d496913b2 100644 --- a/includes/libs/filebackend/FileBackend.php +++ b/includes/libs/filebackend/FileBackend.php @@ -417,7 +417,7 @@ abstract class FileBackend implements LoggerAwareInterface { if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) { return $this->newStatus( 'backend-fail-readonly', $this->name, $this->readOnly ); } - if ( !count( $ops ) ) { + if ( $ops === [] ) { return $this->newStatus(); // nothing to do } @@ -655,7 +655,7 @@ abstract class FileBackend implements LoggerAwareInterface { if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) { return $this->newStatus( 'backend-fail-readonly', $this->name, $this->readOnly ); } - if ( !count( $ops ) ) { + if ( $ops === [] ) { return $this->newStatus(); // nothing to do } diff --git a/includes/libs/filebackend/filejournal/FileJournal.php b/includes/libs/filebackend/filejournal/FileJournal.php index 47be4eba0035..999594b85e81 100644 --- a/includes/libs/filebackend/filejournal/FileJournal.php +++ b/includes/libs/filebackend/filejournal/FileJournal.php @@ -97,7 +97,7 @@ abstract class FileJournal { * @return StatusValue */ final public function logChangeBatch( array $entries, $batchId ) { - if ( !count( $entries ) ) { + if ( $entries === [] ) { return StatusValue::newGood(); } diff --git a/includes/libs/lockmanager/FSLockManager.php b/includes/libs/lockmanager/FSLockManager.php index f2624e721a78..019029c4807c 100644 --- a/includes/libs/lockmanager/FSLockManager.php +++ b/includes/libs/lockmanager/FSLockManager.php @@ -169,7 +169,7 @@ class FSLockManager extends LockManager { if ( $this->locksHeld[$path][$type] <= 0 ) { unset( $this->locksHeld[$path][$type] ); } - if ( !count( $this->locksHeld[$path] ) ) { + if ( $this->locksHeld[$path] === [] ) { unset( $this->locksHeld[$path] ); // no locks on this path if ( isset( $this->handles[$path] ) ) { $handlesToClose[] = $this->handles[$path]; diff --git a/includes/libs/lockmanager/PostgreSqlLockManager.php b/includes/libs/lockmanager/PostgreSqlLockManager.php index 65c69938a486..fd3ffa5cbcd6 100644 --- a/includes/libs/lockmanager/PostgreSqlLockManager.php +++ b/includes/libs/lockmanager/PostgreSqlLockManager.php @@ -18,7 +18,7 @@ class PostgreSqlLockManager extends DBLockManager { protected function doGetLocksOnServer( $lockSrv, array $paths, $type ) { $status = StatusValue::newGood(); - if ( !count( $paths ) ) { + if ( $paths === [] ) { return $status; // nothing to lock } diff --git a/includes/libs/lockmanager/QuorumLockManager.php b/includes/libs/lockmanager/QuorumLockManager.php index 1d2e21aa0d70..1ef4642a84a6 100644 --- a/includes/libs/lockmanager/QuorumLockManager.php +++ b/includes/libs/lockmanager/QuorumLockManager.php @@ -98,7 +98,7 @@ abstract class QuorumLockManager extends LockManager { $bucket = $this->getBucketFromPath( $path ); $pathsToUnlock[$bucket][$type][] = $path; } - if ( !count( $this->locksHeld[$path] ) ) { + if ( $this->locksHeld[$path] === [] ) { unset( $this->locksHeld[$path] ); // no SH or EX locks left for key } } @@ -110,7 +110,7 @@ abstract class QuorumLockManager extends LockManager { foreach ( $pathsToUnlock as $bucket => $pathsToUnlockByType ) { $status->merge( $this->doUnlockingRequestBucket( $bucket, $pathsToUnlockByType ) ); } - if ( !count( $this->locksHeld ) ) { + if ( $this->locksHeld === [] ) { $status->merge( $this->releaseAllLocks() ); $this->degradedBuckets = []; // safe to retry the normal quorum } diff --git a/includes/libs/rdbms/ChronologyProtector.php b/includes/libs/rdbms/ChronologyProtector.php index 938e5345dbe8..3e71e3626b96 100644 --- a/includes/libs/rdbms/ChronologyProtector.php +++ b/includes/libs/rdbms/ChronologyProtector.php @@ -202,7 +202,7 @@ class ChronologyProtector implements LoggerAwareInterface { ); } - if ( !count( $this->shutdownPositions ) ) { + if ( $this->shutdownPositions === [] ) { return []; // nothing to save } diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 9a9e36ac6f82..7d971af9297f 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -2855,7 +2855,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware public function upsert( $table, array $rows, array $uniqueIndexes, array $set, $fname = __METHOD__ ) { - if ( !count( $rows ) ) { + if ( $rows === [] ) { return true; // nothing to do } diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 3fcbcf964d53..186c89f3d661 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -1337,7 +1337,7 @@ abstract class DatabaseMysqlBase extends Database { public function upsert( $table, array $rows, array $uniqueIndexes, array $set, $fname = __METHOD__ ) { - if ( !count( $rows ) ) { + if ( $rows === [] ) { return true; // nothing to do } diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index ca181223c341..ab5c3cda44dc 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -408,7 +408,7 @@ class LoadBalancer implements ILoadBalancer { * @return array (reader index, lagged replica mode) or false on failure */ private function pickReaderIndex( array $loads, $domain = false ) { - if ( !count( $loads ) ) { + if ( $loads === [] ) { throw new InvalidArgumentException( "Empty server array given to LoadBalancer" ); } @@ -476,7 +476,7 @@ class LoadBalancer implements ILoadBalancer { } // If all servers were down, quit now - if ( !count( $currentLoads ) ) { + if ( $currentLoads === [] ) { $this->connLogger->error( __METHOD__ . ": all servers down" ); } |