Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DoctrineBridge] DoctrineDataCollector comments the non runnable part of the query #25346

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -162,8 +162,8 @@ private function sanitizeParam($var)
$className = get_class($var);

return method_exists($var, '__toString') ?
array(sprintf('Object(%s): "%s"', $className, $var->__toString()), false) :
array(sprintf('Object(%s)', $className), false);
array(sprintf('/* Object(%s): */"%s"', $className, $var->__toString()), false) :
array(sprintf('/* Object(%s) */', $className), false);
}

if (is_array($var)) {
Expand All @@ -179,7 +179,7 @@ private function sanitizeParam($var)
}

if (is_resource($var)) {
return array(sprintf('Resource(%s)', get_resource_type($var)), false);
return array(sprintf('/* Resource(%s) */', get_resource_type($var)), false);
}

return array($var, true);
Expand Down
Expand Up @@ -45,7 +45,7 @@ public function onSubmit(FormEvent $event)

// If all items were removed, call clear which has a higher
// performance on persistent collections
if ($collection instanceof Collection && count($data) === 0) {
if ($collection instanceof Collection && 0 === count($data)) {
$collection->clear();
}
}
Expand Down
Expand Up @@ -126,12 +126,12 @@ public function paramProvider()
array(true, array(), true, true),
array(null, array(), null, true),
array(new \DateTime('2011-09-11'), array('date'), '2011-09-11', true),
array(fopen(__FILE__, 'r'), array(), 'Resource(stream)', false),
array(new \stdClass(), array(), 'Object(stdClass)', false),
array(fopen(__FILE__, 'r'), array(), '/* Resource(stream) */', false),
array(new \stdClass(), array(), '/* Object(stdClass) */', false),
array(
new StringRepresentableClass(),
array(),
'Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): "string representation"',
'/* Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): */"string representation"',
false,
),
);
Expand Down