From 10b210d2bb96d78b726626e8ea9fe5849ff63485 Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Fri, 16 Jun 2023 23:48:20 +0200 Subject: [PATCH] feat: compact console output by redacting object annotations --- src/Support/Exporter.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Support/Exporter.php b/src/Support/Exporter.php index 651bec1d..313d081f 100644 --- a/src/Support/Exporter.php +++ b/src/Support/Exporter.php @@ -77,6 +77,12 @@ final class Exporter */ public function shortenedExport(mixed $value): string { - return (string) preg_replace(['#\.{3}#', '#\\\n\s*#'], ['…'], $this->exporter->shortenedExport($value)); + $map = [ + '#\.{3}#' => '…', + '#\\\n\s*#' => '', + '# Object \(…\)#' => '', + ]; + + return (string) preg_replace(array_keys($map), array_values($map), $this->exporter->shortenedExport($value)); } }