From df4cbf5ac603b1dbaf5129d3f87f56badc17c8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 31 Jul 2024 18:56:55 +0200 Subject: 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 --- includes/libs/StatusValue.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'includes/libs/StatusValue.php') 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"; } -- cgit v1.2.3