Skip to content

Commit 1fb13c3

Browse files
committed
Hide a couple of parameters from stack traces
When something goes wrong, the stack trace contains ~10,000 lines of spam, often repeated several times over, which makes it hard to find the actual error
1 parent 78b5bff commit 1fb13c3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

generator/src/Commands/GenerateCommand.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ protected function configure(): void
2525
;
2626
}
2727

28-
protected function execute(InputInterface $input, OutputInterface $output): int
29-
{
30-
28+
protected function execute(
29+
// These aren't actually sensitive, they just fill the
30+
// stack traces with tons of useless information.
31+
#[\SensitiveParameter] InputInterface $input,
32+
#[\SensitiveParameter] OutputInterface $output
33+
): int {
3134
$this->rmGenerated();
3235

3336
// Let's build the DTD necessary to load the XML files.

generator/src/Generator/FileCreator.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ class FileCreator
1919
* @param Method[] $functions
2020
* @param Method[] $missingFunctions
2121
*/
22-
public function generatePhpFile(array $functions, array $missingFunctions, string $path): void
23-
{
22+
public function generatePhpFile(
23+
// These aren't actually sensitive, they just fill the
24+
// stack traces with tons of useless information.
25+
#[\SensitiveParameter] array $functions,
26+
#[\SensitiveParameter] array $missingFunctions,
27+
string $path
28+
): void {
2429
$path = rtrim($path, '/').'/';
2530
$phpFunctionsByModule = [];
2631
foreach ($functions as $function) {

0 commit comments

Comments
 (0)