From 7e0fdf5928a0c726b22ad969267a3b9e0402c823 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 2 Aug 2018 00:06:02 +0200 Subject: [PATCH] fall back to debugInfo() for printing objects Fixes #1122. --- lib/AddressDetails.php | 5 +++++ lib/DebugHtml.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/AddressDetails.php b/lib/AddressDetails.php index 8a4005d9..badf868d 100644 --- a/lib/AddressDetails.php +++ b/lib/AddressDetails.php @@ -114,4 +114,9 @@ class AddressDetails } return $aAddress; } + + public function debugInfo() + { + return $this->aAddressLines; + } } diff --git a/lib/DebugHtml.php b/lib/DebugHtml.php index ff1724d2..a600fae5 100644 --- a/lib/DebugHtml.php +++ b/lib/DebugHtml.php @@ -153,6 +153,8 @@ class Debug $sPre = ', '; } } + } elseif (is_object($mVar) && method_exists($mVar, 'debugInfo')) { + Debug::outputVar($mVar->debugInfo(), $sPreNL); } else { Debug::outputSimpleVar($mVar); } -- 2.43.2