Avoid PHP 7.2 warnings in DBConRefTest about count() on non-Countable
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DBConnRef.php
index 11ce957..decd9bf 100644 (file)
@@ -33,7 +33,7 @@ class DBConnRef implements IDatabase {
                $this->lb = $lb;
                if ( $conn instanceof Database ) {
                        $this->conn = $conn; // live handle
-               } elseif ( count( $conn ) >= 4 && $conn[self::FLD_DOMAIN] !== false ) {
+               } elseif ( is_array( $conn ) && count( $conn ) >= 4 && $conn[self::FLD_DOMAIN] !== false ) {
                        $this->params = $conn;
                } else {
                        throw new InvalidArgumentException( "Missing lazy connection arguments." );
@@ -505,11 +505,13 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
-       public function cancelAtomic( $fname = __METHOD__ ) {
+       public function cancelAtomic( $fname = __METHOD__, AtomicSectionIdentifier $sectionId = null ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
-       public function doAtomicSection( $fname, callable $callback ) {
+       public function doAtomicSection(
+               $fname, callable $callback, $cancelable = self::ATOMIC_NOT_CANCELABLE
+       ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }