Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
}
private function removeValuesFromArgs($args, $values) {
- foreach ($args as &$arg) {
+ $workArgs = [];
+ foreach ($args as $arg) {
if (in_array($arg, $values, true)) {
$arg = '*** sensitive parameter replaced ***';
} elseif (is_array($arg)) {
$arg = $this->removeValuesFromArgs($arg, $values);
}
+ $workArgs[] = $arg;
}
- return $args;
+ return $workArgs;
}
private function encodeTrace($trace) {
$secret = ['Secret'];
$this->emit([&$secret]);
} catch (\Exception $e) {
- $this->serializer->serializeException($e);
+ $serializedData = $this->serializer->serializeException($e);
$this->assertSame(['Secret'], $secret);
+ $this->assertSame('*** sensitive parameters replaced ***', $serializedData['Trace'][0]['args'][0]);
}
}
}