Merge "Replace gettype() with get_debug_type() in exception messages etc."

This commit is contained in:
jenkins-bot 2024-08-16 10:39:46 +00:00 committed by Gerrit Code Review
commit 1aeca2e6b7
3 changed files with 4 additions and 4 deletions

View file

@ -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'
);
}
}

View file

@ -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
}

View file

@ -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 );