From efb2a163929eb75d2ef28db2a7db8f2fea018ea1 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Sat, 28 Aug 2010 11:37:12 +0200 Subject: [PATCH] Rename getMap() to __toString(). --- framework/Cli/lib/Horde/Cli.php | 2 +- framework/Core/lib/Horde.php | 2 +- framework/Support/lib/Horde/Support/Backtrace.php | 2 +- framework/Support/test/Horde/Support/BacktraceTest.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/Cli/lib/Horde/Cli.php b/framework/Cli/lib/Horde/Cli.php index 5d4ac48c2..38f0f8b68 100644 --- a/framework/Cli/lib/Horde/Cli.php +++ b/framework/Cli/lib/Horde/Cli.php @@ -319,7 +319,7 @@ class Horde_Cli $this->writeln($this->red(_("Fatal Error:"))); $this->writeln($this->red($error)); $this->writeln(); - $this->writeln($backtrace->getMap()); + $this->writeln((string)$backtrace); $this->writeln($this->red('====================')); exit(1); } diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 68a7c95c0..4e0ea83a8 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -121,7 +121,7 @@ class Horde $trace = debug_backtrace(); } $backtrace = new Horde_Support_Backtrace($trace); - $errortext .= '
' . $backtrace->getMap() . '
'; + $errortext .= '
' . (string)$backtrace . '
'; if (is_object($error)) { $errortext .= '

' . _("Details") . '

'; $errortext .= '

' . _("The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.") . '

'; diff --git a/framework/Support/lib/Horde/Support/Backtrace.php b/framework/Support/lib/Horde/Support/Backtrace.php index 7a80e016d..29a22a013 100644 --- a/framework/Support/lib/Horde/Support/Backtrace.php +++ b/framework/Support/lib/Horde/Support/Backtrace.php @@ -117,7 +117,7 @@ class Horde_Support_Backtrace * * @return string The backtrace map. */ - public function getMap() + public function __toString() { $count = count($this->_backtrace); $pad = strlen($count); diff --git a/framework/Support/test/Horde/Support/BacktraceTest.php b/framework/Support/test/Horde/Support/BacktraceTest.php index 12d25e6ab..5353488ce 100644 --- a/framework/Support/test/Horde/Support/BacktraceTest.php +++ b/framework/Support/test/Horde/Support/BacktraceTest.php @@ -84,16 +84,16 @@ class Horde_Support_BacktraceTest extends PHPUnit_Framework_TestCase $this->assertEquals(count($dbt), $backtrace->getNestingLevel()); } - public function testGetMap() + public function testToString() { $backtrace = new Horde_Support_Backtrace(array_slice($this->instanceMethod(), 0, 4)); $file = __FILE__; - $this->assertEquals("1. Horde_Support_BacktraceTest->testGetMap() + $this->assertEquals("1. Horde_Support_BacktraceTest->testToString() 2. Horde_Support_BacktraceTest->instanceMethod() $file:89 3. Horde_Support_BacktraceTest::staticMethod() $file:29 4. backtraceTestFunction() $file:34 ", - $backtrace->getMap()); + (string)$backtrace); } public function returnBacktrace() -- 2.11.0