mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-23 10:18:22 +00:00
Merge "Replace gettype() with get_debug_type() in exception messages etc."
This commit is contained in:
commit
1aeca2e6b7
|
@ -98,7 +98,7 @@ class AFPData {
|
|||
return new AFPData( self::DNULL );
|
||||
default:
|
||||
throw new InternalException(
|
||||
'Data type ' . gettype( $var ) . ' is not supported by AbuseFilter'
|
||||
'Data type ' . get_debug_type( $var ) . ' is not supported by AbuseFilter'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class VariablesManager {
|
|||
} else {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \UnexpectedValueException(
|
||||
"Variable $varName has unexpected type " . gettype( $variable )
|
||||
"Variable $varName has unexpected type " . get_debug_type( $variable )
|
||||
);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
|
|
@ -338,7 +338,7 @@ class UpdateVarDumps extends LoggedUpdateMaintenance {
|
|||
}
|
||||
if ( !is_array( $stored ) && !( $stored instanceof VariableHolder ) ) {
|
||||
$this->fatalError(
|
||||
'...found unexpected data type ( ' . gettype( $stored ) . ' ) in ' .
|
||||
'...found unexpected data type ( ' . get_debug_type( $stored ) . ' ) in ' .
|
||||
"afl_var_dump for afl_id {$row->afl_id}.\n"
|
||||
);
|
||||
}
|
||||
|
@ -564,7 +564,7 @@ class UpdateVarDumps extends LoggedUpdateMaintenance {
|
|||
} elseif ( is_array( $obj ) ) {
|
||||
$varArray = $obj;
|
||||
} else {
|
||||
$type = is_object( $obj ) ? get_class( $obj ) : gettype( $obj );
|
||||
$type = get_debug_type( $obj );
|
||||
throw new UnexpectedValueException( "Unexpected type for stored blob: $type" );
|
||||
}
|
||||
$varArray = $this->updateVariables( $varArray );
|
||||
|
|
Loading…
Reference in a new issue