From 1a317ebe313252c08fcbf3f89388b06414975d0f Mon Sep 17 00:00:00 2001 From: Rinat Silnov Date: Sat, 4 May 2013 23:54:59 +0400 Subject: [PATCH] Fixed VarDumper::dump for objects Otherwise it throws an exception that "Object of class ClassName could not be converted to string" --- framework/helpers/base/VarDumper.php | 2 +- tests/unit/framework/helpers/VarDumperTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/unit/framework/helpers/VarDumperTest.php diff --git a/framework/helpers/base/VarDumper.php b/framework/helpers/base/VarDumper.php index fe15d98..43b0cd8 100644 --- a/framework/helpers/base/VarDumper.php +++ b/framework/helpers/base/VarDumper.php @@ -116,7 +116,7 @@ class VarDumper } elseif (self::$_depth <= $level) { self::$_output .= get_class($var) . '(...)'; } else { - $id = self::$_objects[] = $var; + $id = array_push(self::$_objects, $var); $className = get_class($var); $members = (array)$var; $spaces = str_repeat(' ', $level * 4); diff --git a/tests/unit/framework/helpers/VarDumperTest.php b/tests/unit/framework/helpers/VarDumperTest.php new file mode 100644 index 0000000..8757588 --- /dev/null +++ b/tests/unit/framework/helpers/VarDumperTest.php @@ -0,0 +1,12 @@ +