aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/StatusValue.php
diff options
context:
space:
mode:
authorBartosz Dziewoński <dziewonski@fastmail.fm>2024-07-31 18:56:55 +0200
committerBartosz Dziewoński <dziewonski@fastmail.fm>2024-07-31 19:33:57 +0200
commitdf4cbf5ac603b1dbaf5129d3f87f56badc17c8d0 (patch)
tree4768be15b11805af8c9fba7cdb702b34bb948644 /includes/libs/StatusValue.php
parentc045fa0291778f15c63b9bb73b1b840fe85ef62f (diff)
downloadmediawikicore-df4cbf5ac603b1dbaf5129d3f87f56badc17c8d0.tar.gz
mediawikicore-df4cbf5ac603b1dbaf5129d3f87f56badc17c8d0.zip
Replace gettype() with get_debug_type() in debug/log/test output
get_debug_type() does the same thing but better (spelling type names in the same way as in type declarations, and including names of object classes and resource types). It was added in PHP 8, but the symfony/polyfill-php80 package provides it while we still support 7.4. Also remove uses of get_class() and get_resource_type() where the new method already provides the same information. For reference: https://www.php.net/manual/en/function.get-debug-type.php https://www.php.net/manual/en/function.gettype.php In this commit I'm only changing code where it looks like the result is used only for some king of debug, log, or test output. This probably won't break anything important, but I'm not sure whether anything might depend on the exact values. Change-Id: I7c1f0a8f669228643e86f8e511c0e26a2edb2948
Diffstat (limited to 'includes/libs/StatusValue.php')
-rw-r--r--includes/libs/StatusValue.php5
1 files changed, 1 insertions, 4 deletions
diff --git a/includes/libs/StatusValue.php b/includes/libs/StatusValue.php
index f5013571eece..5c2262a3ccf0 100644
--- a/includes/libs/StatusValue.php
+++ b/includes/libs/StatusValue.php
@@ -497,10 +497,7 @@ class StatusValue implements Stringable {
$errorcount = "no errors detected";
}
if ( isset( $this->value ) ) {
- $valstr = gettype( $this->value ) . " value set";
- if ( is_object( $this->value ) ) {
- $valstr .= "\"" . get_class( $this->value ) . "\" instance";
- }
+ $valstr = get_debug_type( $this->value ) . " value set";
} else {
$valstr = "no value set";
}