Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3f9d16

Browse files
committed
DoctrineDataCollector object stringable representation format changed
1 parent c3ed81c commit d3f9d16

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ private function sanitizeQuery($connectionName, $query)
159159
private function sanitizeParam($var)
160160
{
161161
if (is_object($var)) {
162+
$className = get_class($var);
162163
return method_exists($var, '__toString') ?
163-
array($var->__toString(), false) :
164-
array(sprintf('Object(%s)', get_class($var)), false);
164+
array(sprintf('Object(%s): "%s"', $className, $var->__toString()), false) :
165+
array(sprintf('Object(%s)', $className), false);
165166
}
166167

167168
if (is_array($var)) {

src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ public function paramProvider()
128128
array(new \DateTime('2011-09-11'), array('date'), '2011-09-11', true),
129129
array(fopen(__FILE__, 'r'), array(), 'Resource(stream)', false),
130130
array(new \stdClass(), array(), 'Object(stdClass)', false),
131-
array(new StringRepresentableClass('presentation test'), array(), 'presentation test', false),
131+
array(
132+
new StringRepresentableClass('presentation test'),
133+
array(),
134+
'Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): "presentation test"',
135+
false,
136+
),
132137
);
133138
}
134139

0 commit comments

Comments
 (0)