* @file
*/
+use Wikimedia\Rdbms\ResultWrapper;
+
/**
* This is a base class for all Query modules.
* It provides some common functionality such as constructing various SQL
/**
* Equivalent to addWhere(array($field => $value))
* @param string $field Field name
- * @param string $value Value; ignored if null or empty array;
+ * @param string|string[] $value Value; ignored if null or empty array;
*/
protected function addWhereFld( $field, $value ) {
// Use count() to its full documented capabilities to simultaneously
* Add an option such as LIMIT or USE INDEX. If an option was set
* before, the old value will be overwritten
* @param string $name Option name
- * @param string $value Option value
+ * @param string|string[] $value Option value
*/
protected function addOption( $name, $value = null ) {
if ( is_null( $value ) ) {
* @return bool
*/
public function validateSha1Hash( $hash ) {
- return preg_match( '/^[a-f0-9]{40}$/', $hash );
+ return (bool)preg_match( '/^[a-f0-9]{40}$/', $hash );
}
/**
* @return bool
*/
public function validateSha1Base36Hash( $hash ) {
- return preg_match( '/^[a-z0-9]{31}$/', $hash );
+ return (bool)preg_match( '/^[a-z0-9]{31}$/', $hash );
}
/**