Use the standard PHP 8.2 replacement value, instead of the `[redacted]` string
for consistency. This works as expected, because `SensitiveParameterValue` is
polyfilled.
$isSensitive = true;
}
- if ($isSensitive && isset($item['args'][$i])) {
- $item['args'][$i] = '[redacted]';
+ if (
+ $isSensitive
+ && isset($item['args'][$i])
+ && !($item['args'][$i] instanceof \SensitiveParameterValue)
+ ) {
+ $item['args'][$i] = new \SensitiveParameterValue($item['args'][$i]);
}
$i++;
}
|| $item['class'] === 'PDO'
) {
if ($item['function'] === '__construct') {
- $item['args'] = array_map(function () {
- return '[redacted]';
+ $item['args'] = array_map(function ($value) {
+ if (!($value instanceof \SensitiveParameterValue)) {
+ $value = new \SensitiveParameterValue($value);
+ }
+
+ return $value;
}, $item['args']);
}
}