X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseMysqlBase.php;h=3ecfca9108302e784e12ce94711abb5c450c85b9;hb=ceea38e8ad163a26f4ec7be7128747c84a904fcd;hp=953f63d2ffaa6bcd3ce3fa39a13aebf3d880f2a4;hpb=930a808814ac1dae6d851de1bef780b9142f9a51;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 953f63d2ff..3ecfca9108 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -96,12 +96,8 @@ abstract class DatabaseMysqlBase extends Database { * @param array $params */ function __construct( array $params ) { - $this->lagDetectionMethod = isset( $params['lagDetectionMethod'] ) - ? $params['lagDetectionMethod'] - : 'Seconds_Behind_Master'; - $this->lagDetectionOptions = isset( $params['lagDetectionOptions'] ) - ? $params['lagDetectionOptions'] - : []; + $this->lagDetectionMethod = $params['lagDetectionMethod'] ?? 'Seconds_Behind_Master'; + $this->lagDetectionOptions = $params['lagDetectionOptions'] ?? []; $this->useGTIDs = !empty( $params['useGTIDs' ] ); foreach ( [ 'KeyPath', 'CertPath', 'CAFile', 'CAPath', 'Ciphers' ] as $name ) { $var = "ssl{$name}"; @@ -109,7 +105,7 @@ abstract class DatabaseMysqlBase extends Database { $this->$var = $params[$var]; } } - $this->sqlMode = isset( $params['sqlMode'] ) ? $params['sqlMode'] : ''; + $this->sqlMode = $params['sqlMode'] ?? ''; $this->utf8Mode = !empty( $params['utf8Mode'] ); $this->insertSelectIsSafe = isset( $params['insertSelectIsSafe'] ) ? (bool)$params['insertSelectIsSafe'] : null; @@ -376,7 +372,7 @@ abstract class DatabaseMysqlBase extends Database { // Unfortunately, mysql_num_rows does not reset the last errno. // We are not checking for any errors here, since - // these are no errors mysql_num_rows can cause. + // there are no errors mysql_num_rows can cause. // See https://dev.mysql.com/doc/refman/5.0/en/mysql-fetch-row.html. // See https://phabricator.wikimedia.org/T44430 return $n; @@ -502,7 +498,7 @@ abstract class DatabaseMysqlBase extends Database { /** * Returns the text of the error message from previous MySQL operation * - * @param resource $conn Raw connection + * @param resource|null $conn Raw connection * @return string */ abstract protected function mysqlError( $conn = null ); @@ -1461,7 +1457,7 @@ abstract class DatabaseMysqlBase extends Database { /** * List all tables on the database * - * @param string $prefix Only show tables with this prefix, e.g. mw_ + * @param string|null $prefix Only show tables with this prefix, e.g. mw_ * @param string $fname Calling function name * @return array */ @@ -1515,7 +1511,7 @@ abstract class DatabaseMysqlBase extends Database { /** * Lists VIEWs in the database * - * @param string $prefix Only show VIEWs with this prefix, eg. + * @param string|null $prefix Only show VIEWs with this prefix, eg. * unit_test_, or $wgDBprefix. Default: null, would return all views. * @param string $fname Name of calling function * @return array @@ -1551,7 +1547,7 @@ abstract class DatabaseMysqlBase extends Database { * Differentiates between a TABLE and a VIEW. * * @param string $name Name of the TABLE/VIEW to test - * @param string $prefix + * @param string|null $prefix * @return bool * @since 1.22 */